Click here to Skip to main content
15,441,629 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Find the 4th Tue of the Month when the Year changes Pin
Choroid1-Jan-22 2:18
MemberChoroid1-Jan-22 2:18 
QuestionI need help. how do i code it??? Pin
Member 1548021627-Dec-21 15:33
MemberMember 1548021627-Dec-21 15:33 
AnswerRe: I need help. how do i code it??? Pin
Richard MacCutchan27-Dec-21 21:46
mveRichard MacCutchan27-Dec-21 21:46 
QuestionHow to display actual values on a chart using the Mouse_Move event. Pin
zomalaja25-Dec-21 13:10
Memberzomalaja25-Dec-21 13:10 
QuestionHow to BitConverter.GetBytes() return 2 digits only Pin
EngrImad3-Dec-21 23:39
MemberEngrImad3-Dec-21 23:39 
GeneralRe: How to BitConverter.GetBytes() return 2 digits only Pin
Richard MacCutchan4-Dec-21 0:18
mveRichard MacCutchan4-Dec-21 0:18 
AnswerRe: How to BitConverter.GetBytes() return 2 digits only Pin
EngrImad4-Dec-21 1:54
MemberEngrImad4-Dec-21 1:54 
AnswerRe: How to BitConverter.GetBytes() return 2 digits only Pin
Dave Kreskowiak4-Dec-21 3:43
mveDave Kreskowiak4-Dec-21 3:43 
An int16 (or 'short') is a two-byte value. Intel processors are "little-endian", meaning the last byte (least significant) is stored first and the first byte (most significant) is stored last.

In your example, your two byte value, (12) 0x000C, is stored in memory like this: 0x0C, 0x00. So that's why you're getting the bytes in the order you are. BitConverter is returning the bytes in the order they appear in memory.

If you were running the exact same code on a processor that is big-endian, the bytes would show up in the array in the order opposite of what you're seeing now.

Now, having said all that, if you're looking for just getting a string for the hexadecimal representation of your value, all you have to do is this:
VB.NET
Dim myInt As Int16 = 12
result = String.Format("X", myInt)

If you're dealing with values that will never be greater than 255, why are you using an Int16? Why not just use Byte instead?

Questionerror 50003 in vb6 in win 10 Pin
Member 110192491-Dec-21 0:10
MemberMember 110192491-Dec-21 0:10 
AnswerRe: error 50003 in vb6 in win 10 Pin
jsc421-Dec-21 0:26
professionaljsc421-Dec-21 0:26 
AnswerRe: error 50003 in vb6 in win 10 Pin
Richard Deeming1-Dec-21 1:08
mveRichard Deeming1-Dec-21 1:08 
QuestionHi How can i print listview with database im using phpmyadmin xampp Pin
Kyooshi29-Nov-21 19:54
MemberKyooshi29-Nov-21 19:54 
AnswerRe: Hi How can i print listview with database im using phpmyadmin xampp Pin
Richard Deeming29-Nov-21 21:47
mveRichard Deeming29-Nov-21 21:47 
AnswerRe: Hi How can i print listview with database im using phpmyadmin xampp Pin
Richard MacCutchan29-Nov-21 21:56
mveRichard MacCutchan29-Nov-21 21:56 
Questionface identification and recognition with visual Basic 2010 Pin
Member 1535104216-Nov-21 23:20
MemberMember 1535104216-Nov-21 23:20 
AnswerRe: face identification and recognition with visual Basic 2010 Pin
Richard MacCutchan16-Nov-21 23:27
mveRichard MacCutchan16-Nov-21 23:27 
AnswerRe: face identification and recognition with visual Basic 2010 Pin
CHill6024-Nov-21 0:32
mveCHill6024-Nov-21 0:32 
QuestionHOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
WAHID ASSOCIATES8-Nov-21 9:09
MemberWAHID ASSOCIATES8-Nov-21 9:09 
AnswerRe: HOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
Member 153296138-Nov-21 10:39
MemberMember 153296138-Nov-21 10:39 
AnswerRe: HOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
Dave Kreskowiak8-Nov-21 11:38
mveDave Kreskowiak8-Nov-21 11:38 
AnswerRe: HOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
Mycroft Holmes8-Nov-21 11:50
professionalMycroft Holmes8-Nov-21 11:50 
GeneralRe: HOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
den2k888-Nov-21 21:49
professionalden2k888-Nov-21 21:49 
GeneralRe: HOW TO CODE A REFRESH BUTTON IN VB.NET FORM Pin
Eddy Vluggen10-Nov-21 5:44
professionalEddy Vluggen10-Nov-21 5:44 
QuestionSave, Retrieve Image on SQL Database using VB.net Pin
EngrImad6-Nov-21 10:42
MemberEngrImad6-Nov-21 10:42 
AnswerRe: Save, Retrieve Image on SQL Database using VB.net Pin
RedDk6-Nov-21 11:10
MemberRedDk6-Nov-21 11:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.