Solved

Return Value

Posted on 2009-07-16
3
140 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
Comment Utility
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
Comment Utility
mwvisa1, what happen if i get the character ACK how do i represent it?
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now