Solved

Return Value

Posted on 2009-07-16
3
144 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 59

Accepted Solution

by:
Kevin Cross earned 500 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 59

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 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