News:

Choose a design and let our professionals help you build a successful website   - ITAcumens

Main Menu

Convert a character to and from its ASCII code

Started by nandagopal, Nov 20, 2008, 09:09 PM

Previous topic - Next topic

nandagopal

Use Asc to get a character's ASCII code. Use Chr to convert an ASCII code into a character.

Private Sub Command2_Click()
     'Code the character
     Label3 = Asc(Text1)
     'clears text box
     Text1 = ""
     ' adds the coded character to textbox (label3)
     LABEL6 = LABEL6 + "," + Label3
     ' set focus to textbox
     Text1.SetFocus
     'decodes the coded character
     Text2 = Text2 + Chr(Label3)
End Sub

Private Sub Command3_Click()
     'this part decodes the coded number
     Label3 = Text3
     Text3 = ""
     LABEL6 = LABEL6 + "," + Label3
     Text2 = Text2 + Chr(Label3)
     Text3.SetFocus
End Sub