Compatible Support Forums: Ascii code in VB6

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ascii code in VB6

#1 User is offline   j_a_rasheed 

  • stranger
  • Group: Members
  • Posts: 13
  • Joined: 13-March 06

Posted 23 July 2006 - 08:02 PM

Hi,
I need to write a function to convert characters into their binary equivalent.
Which function do we use to get the ascii code of a character - e.g an 'A' is 65 and and which function do we use to return the character associated with an Ascii code eg 65 will return an 'A'.
In Foxpro we use the fuctions ASC() and CHR().
I am new to VB6
Thanks
*****
0

#2 User is offline   Wilhelmus 

  • old hand
  • Group: Members
  • Posts: 1032
  • Joined: 21-December 04
  • LocationFinland

Posted 25 July 2006 - 01:32 AM

Asc, AscW Functions.

Chr, ChrW Functions.

Something like this (for one character and ascii code):

Character to ascii:
Dim asciiInt As Integer
asciiInt = Asc(CharacterBox.Text)
AsciiLabel.Text = asciiInt.ToString

Ascii to character code:
Dim asciiChar As Char
asciiChar = Chr(AsciiBox.Text)
CharacterLabel.Text = asciiChar.ToString


0

#3 User is offline   j_a_rasheed 

  • stranger
  • Group: Members
  • Posts: 13
  • Joined: 13-March 06

Posted 03 August 2006 - 10:14 AM

thanks wilhemus
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users