|
-
Mar 12th, 2004, 01:05 AM
#1
Thread Starter
Hyperactive Member
Super easy string question
I have a character
dim x as char
How do I determine it's ascii value so that
x = "a"
returns 36 (or whatever - it might be 50 something)
In VB6, I would do
? asc(x)
or
? char(x)
depending but in .Net I was expecting
? x.ToAscii
but char's don't support that.
Rate my response if I helped
Go Hard Or Go Home
-
Mar 12th, 2004, 02:40 AM
#2
Sleep mode
VB Code:
Dim x As Char = "P"
MessageBox.Show(Asc(x)) 'returns 80
-
Mar 12th, 2004, 10:19 AM
#3
Thread Starter
Hyperactive Member
So it's the same?
.Net is so inconsistent ...
Rate my response if I helped
Go Hard Or Go Home
-
Mar 12th, 2004, 10:26 AM
#4
Sleep mode
Originally posted by Gary Campbell
So it's the same?
.Net is so inconsistent ...
Yeah , same function . Actually , this function is imported from the compatibiliy namesapce (Miscrosoft.VisualBasic) .
-
Mar 12th, 2004, 12:36 PM
#5
yay gay
Well in c# we can do (int)char and in vb.net it might be something like CType('c', integer)
\m/  \m/
-
Mar 12th, 2004, 03:51 PM
#6
Sleep mode
Originally posted by PT Exorcist
in vb.net it might be something like CType('c', integer)
It won't work .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|