ASC

From QB64 Wiki
Revision as of 01:43, 27 July 2009 by 81.231.142.40 (talk) (Created page with 'ASC returns the ASCII code for a certain character. If the string used with ASC has more than one character, the first character is used. ''Example:'' :PRINT ASC("A") :PRINT A…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ASC returns the ASCII code for a certain character.

If the string used with ASC has more than one character, the first character is used.


Example:

PRINT ASC("A")
PRINT ASC("Be a rockstar")

Returns:

65
66

Explanation:

The ASCII code for "A" is 65 and the ASCII code for "B" is 66.

Note:

The ASCII code for "A" and "a" are different by the value of 32, "A" + 32 is "a", 65("A") + 32 = 97("a").


See also:

CHR$ (function)