Asc()

AutoHotkey

Asc()

Returns the numeric value of the first byte or UTF-16 code unit in the specified string.

Number := Asc(String)

Parameters

String

The string whose numeric value is retrieved.

Return Value

This function returns a numeric value in the range 0 to 255 (for ANSI) or 0 to 0xFFFF (for Unicode). See Unicode vs ANSI for details. If String is empty, it returns 0.

Remarks

This function is equivalent to Transform, OutputVar, Asc.

To allow for Unicode supplementary characters, use Ord(String) instead.

Related

Transform, Ord(), Chr()

Examples

; Both message boxes below show 116, because only the first character is considered.
MsgBox, % Asc("t") 
MsgBox, % Asc("test")