Asc

From Xojo Documentation
Jump to: navigation, search
Method

Returns the integer code point for the first character in the string using the character's encoding.

Syntax

result = Asc(string)
OR
result = stringVariable.Asc

Part Type Description
result Integer The ASCII value of the first character of string.
string String Any valid string expression.
StringVariable String Any variable of type String.

Notes

The Asc function returns the code point for the first character in the passed String in the characters encoding. Characters 0 through 127 are the standard ASCII set, which are the same on practically every encoding.

If you need to get the ASCII code of the first byte of the string rather than the first character, use the AscB function.

Examples

This example uses the Asc function to get the ASCII value of a character.

Dim a As Integer
a = Asc("A") // returns 65

This example gets the code point for the "≥" symbol

Dim s As String
Dim n As Integer
s = "≥"
n = s.Asc

See Also

AscB, Chr, InStr, Left, Len, Mid, Right functions; TextEncoding class.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About