Tuesday, November 16, 2010

How do I convert to ASCII values in VB?

Basically, if I give my program a number (ex. 32), it will convert it to whatever character has that ascii value (in this case '@')

33 = !

38 = %26amp;

48 = 0

97 = a

and so on.



Thanks!How do I convert to ASCII values in VB?
You can use this functions:



The 'Asc' function will convert your character to its ASCII,

聽 Asc(your character in string form)



The 'Chr' function will convert your ASCII number to its character,

聽Chr(your ascii number in integer form)



And also you can use 'AscW' , 'ChrW' and 'AscB' , 'ChrB' instead of 'Asc' , 'Chr' for Unicode and Binary code.

No comments:

Post a Comment