Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Return Value

Posted on 2009-07-16
3
Medium Priority
?
148 Views
Last Modified: 2012-05-07
I have a value of 0 and i want to convert it to Hex 0x00 how can I do this if I use the below method I will return a 30 in hex which is 0 however i want it to be null

 Public MM_UC_Lenght_MSB As String = "0"
MM_UC_Lenght_MSB = Strings.Asc(MM_UC_Lenght_MSB)
            MM_UC_Lenght_MSB = Conversion.Hex(MM_UC_Lenght_MSB)
            MM_Configuration_Data_Array.Add(MM_UC_Lenght_MSB)
0
Comment
Question by:cmdolcet
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 24871440
Hello cmdolcet

Try using the VB vbNullChar constant.

Regards,

mwvisa1
Public MM_UC_Lenght_MSB As String = vbNullChar
MM_UC_Lenght_MSB = Strings.Asc(MM_UC_Lenght_MSB) 
MM_UC_Lenght_MSB = Conversion.Hex(MM_UC_Lenght_MSB) 
MM_Configuration_Data_Array.Add(MM_UC_Lenght_MSB)

Open in new window

0
 

Author Comment

by:cmdolcet
ID: 24873194
mwvisa1, what happen if i get the character ACK how do i represent it?
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24873423
ACK has a decimal value in ASCII of 6 if I am not mistaken, so would be like this: Chr(6).
Similarly, you can set other values based on their char int value using the Chr() function.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question