int to a
-
Hi all! how can I convert the number ( 42 ) to A I mean in ASCII code 42 is an "A" so If I have number 42 how can I convert it into "A" in VB. I know that in C++ I can used IsAlpha(). Thanks
Hi Win Here's the VB.NET code (hope this is the VB ver. you wanted):
Imports System.Text.Encoding
Imports Microsoft.VisualBasicModule Module1
Sub Main() Dim i As Integer = AscW("A") Console.WriteLine(i.ToString()) Dim c As Char = ChrW(i) Console.WriteLine(c.ToString()) Console.ReadLine() End Sub
End Module
Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG
-
Hi Win Here's the VB.NET code (hope this is the VB ver. you wanted):
Imports System.Text.Encoding
Imports Microsoft.VisualBasicModule Module1
Sub Main() Dim i As Integer = AscW("A") Console.WriteLine(i.ToString()) Dim c As Char = ChrW(i) Console.WriteLine(c.ToString()) Console.ReadLine() End Sub
End Module
Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG
-
Cool, glad it helped. The wierd thing is that MS/other seem to recommend not using the Microsoft.VisualBasic namespace as (I think) it uses interop in the background. Perhaps keep this code in a single function so it won't be too much of a sweat to change later, if necessary. I'll keep a look out for an alternative. Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG
-
Cool, glad it helped. The wierd thing is that MS/other seem to recommend not using the Microsoft.VisualBasic namespace as (I think) it uses interop in the background. Perhaps keep this code in a single function so it won't be too much of a sweat to change later, if necessary. I'll keep a look out for an alternative. Cheers, Simon "The day I swan around in expensive suits is the day I hope someone puts a bullet in my head.", Chris Carter. animation mechanics in SVG
Hmmm.....isn't easier to use the Chr function??
Chr(65) = "A"
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain -
Hmmm.....isn't easier to use the Chr function??
Chr(65) = "A"
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark TwainWould have been the way I would go.
Paul Watson wrote: "At the end of the day it is what you produce that counts, not how many doctorates you have on the wall."
George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things."
-
Hmmm.....isn't easier to use the Chr function??
Chr(65) = "A"
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning Mark Twain
Get your facts first, and then you can distort them as much as you please Mark Twain