4.6  •  5.0  •  5.1  •  5.2  •  5.3

Asc(t, n)

Asc(t) Returns the Unicode value (a number between 0 and 1,114,111 = 0x10FFFF) of the first character in text value «t». This is occasionally useful, for example to understand the alphabetic ordering of text values.

Asc(t, n) returns the unicode value for the «n»th character of «t».


Asc('Hello') → 104
Local t:='Hello' Do Asc(t, 1..TextLength(t)) → [72, 101, 108, 108, 111]
Asc('Δ') → 916
Asc('日本') → 26085
Asc('日本', 2) → 26412
Asc('𠩵') → 133749 { in hex, 0x20a75 }


  • Analytica 5.0: Character range was expanded to include the unicode supplemental planes, hex 0x010000 to 0x10FFFF.
  • Analytica 4.5: Character set was expanded (and changed) from ASCII (0-255) to Unicode (0-65535).
  • Analytica 4.0: The character map (from ASCII code to actual character) for characters in the range of 128-255 has changed in Analytica 4.0 relative to what it was in Analytica 3.1. In Analytica 4.0, the mapping is consistent with Windows, while Analytica 3.1 used the Macintosh standard mapping. This change was enacted to facilitate more seamless copy/paste and other operations. The change is transparent in most areas of Analytica, but can be seen in the results of Asc and Chr.


Text functions

See Also


You are not allowed to post comments.