Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get first two characters from Hex string?

Status
Not open for further replies.

Ciralia

Programmer
Oct 22, 2002
51
US
Hi, I was wondering if anyone knew a function that would give me the first byte of Hex characters from a hex string. Now keep in mind that I would not know the value of the characters, so I could not use any function looking for a specific string. For example: the user enters a number and it is converted to Hex behind the scenes. Lets say the number is 0xABCD. I want the AB to be stored in string variable x. But since I cannot search for AB in the string, how would I do this?
 
When I put that line of code using Mid$ it is asking me for an '=' . Now if the variable I want to store the value in is 'x', would it look like this?

x = Mid$(<what goes here> , 3, 2)
 
...... Or you could always put your cursor on the word Mid$ in your code window and then hit {F1}

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top