ASC function
Purpose: ASC returns the ASCII value of a character.
Syntax: RetVal% = ASC(Character$, [Index%]) Parameters:
Return Value:
|
Example 1 : This example will return the ASCII value for "A", the first character in the string "ABC".
DIMRetVal% RetVal%=ASC("ABC")
Result:
65
Example 2 : This example will return the ASCII value for "C", the third character in the string "ABC".
DIMRetVal% RetVal%=ASC("ABC",2)
Result:
67
Remarks: CHR$ is a function complementary to ASC. CHR$ returns the literal character when given an ASCII integer argument.
BCX Console Sample Programs using ASC function.