✔ Appearance ✔ Standard ✔ Console
ASCIIcode% = asc( string$ ) ASCIIcode% = asc( container$$ )
July 28, 2000 (Release 3)
Returns the ASCII character code for the first character in
container$$. (A character code is a numeric value in the range of 0 through 255 that represents a specific character in the American Standard Code for Information Interchange (ASCII).) If
container$$) contains no characters, then
asc( string$ ) returns zero.
The ASCII character codes between 32 and 127 represent standard characters which generally remain the same from one font family to another. Codes greater than 127 represent different sets of characters depending on the font. Codes below 32 usually represent non-printing "characters."
If the string is a single-character literal, such as "G", then you should consider using the underscore-literal syntax instead, as in this example:
ASCIIcode% = _"G"
The above code executes much faster than
ASCIIcode% = asc( "G" ).
You can use the following syntax to return the ASCII code of the
n-th character in a string variable
ASCIIcode% = stringVar$[n]