ASC Function                                                                                                                               

Returns the ANSI character code corresponding to the first letter in a string.

 

ASC(expression)

 

Arguments

expression    String- The string argument is any valid string expression. If the string contains no characters, a run-time error occurs. 

 

Remarks

This function returns an integer value.

 

Example

In the following example, Asc returns the ANSI character code of the first letter of each string: 

Dim Result as integer

Result = Asc("A")       // Returns 65.

Result = Asc("a")       // Returns 97.

Result = Asc("Apple")   // Returns 65.