Ascii code in VB6

This is a discussion about Ascii code in VB6 in the Windows Security category; 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'.

Windows Security 292 This topic was started by ,


data/avatar/default/avatar23.webp

13 Posts
Location -
Joined 2006-03-13
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
*****

Participate in our website and join the conversation

You already have an account on our website? To log in, use the link provided below.
Login
Create a new user account. Registration is free and takes only a few seconds.
Register
This subject has been archived. New comments and votes cannot be submitted.
Jul 23
Created
Aug 3
Last Response
0
Likes
1 minute
Read Time
User User
Users

Responses to this topic


data/avatar/default/avatar09.webp

1019 Posts
Location -
Joined 2004-12-21
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