JavaScript Editor js editor     Web development 



Main Page

Returns the ANSI value for the leftmost character in a character expression.

ASC(cExpression)

Parameters

cExpression


Specifies the character expression containing the character whose ANSI value ASC(В ) returns. Any characters after the first character in cExpression are ignored by ASC(В ).

Return Value

Numeric

Remarks

ASC(В ) returns the position of the character in the character table of the current code page. Every character has a unique ANSI value in the range from 0 to 255.

Example

The following example displays the characters A through J and uses ASC(В ) to display their corresponding ANSI values.

В Copy Code
STORE 'ABCDEFGHIJ' TO gcANSI  && 10 characters
CLEAR
FOR nCOUNT = 1 TO 10
   ? SUBSTR(gcANSI, nCount,1)  && Display a character
   ?? ASC(SUBSTR(gcANSI, nCount)) && Display ANSI value
ENDFOR

See Also



JavaScript Editor js editor     Web development