Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 whats the vb equivalent of the cmd "ord" in turing
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tifg




PostPosted: Wed Dec 20, 2006 9:14 am   Post subject: whats the vb equivalent of the cmd "ord" in turing

the ord statement in turing turns a letter into the corresponding number in the ASCII code... does any one kno if the same function exist for vb?
Sponsor
Sponsor
Sponsor
sponsor
Silent Avenger




PostPosted: Wed Dec 20, 2006 5:55 pm   Post subject: (No subject)

Try using this code:
code:
Private Sub Form_KeyPress(KeyAscii As Integer)
Form1.Caption = KeyAscii
End Sub

Just run the program and start pushing keys and the code will appear in the caption of the form. Also note that some keys don't have a keyascii code.
Numbah51




PostPosted: Wed Dec 20, 2006 9:23 pm   Post subject: (No subject)

asc()
putting the letter in quotes in the brackets would work
for example:
msgbox asc("k")
tifg




PostPosted: Wed Dec 20, 2006 10:02 pm   Post subject: (No subject)

ooo tru! asc() is EXACTLY what i was looking for.. thnx
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: