Function Asc() Foundation

Converts a character to its numeric ASCII code.

Syntax
Asc( <cExpression> ) --> nAsciiCode
Parameters
<cExpression>
<cExpression> is the character expression whose ASCII code is determined.
Return

The return value of Asc() is an integer numeric value in the range 0 to 255. It is the ASCII code of <cExpression>.

Description

The conversion function Asc() determines the ASCII code for the first character of a character string. The counterpart of Asc() is the function Chr(), which converts an ASCII code to an ASCII character.

Examples
Asc()
// The example demonstrates the return values of Asc(). 

PROCEDURE Main 

   ? Asc("A")                     // result: 65 
   ? Asc("Xbase++")               // result: 88 
   ? Asc("xbase++")               // result: 120 
   ? Asc( Chr(0) )                // result: 0 
   ? Asc("")                      // result: 0 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.