Function Entry: ASCII
← Prev | ↑ Chapter | Next → | Index | Symbols
Function Entry: ASCII
Name
ascii
Class
Function
Syntax
(ascii string)
Arguments and Values
string: string whose first character is examined
Description
Returns the code of the first character in the string.
Return Values
Integer character code.
Side Effects
None.
Compatibility
Autodesk explicitly documents behavior changes after AutoCAD 2021 due to Unicode support.
Notes
This function is one of the clearest probes into the observable character model of a given host/version.
Measured: character codes at LISPSYS 0
probe-triage2, 2026-10-04 (strings built with chr, never source literals):
- AutoCAD 2022, Windows, LISPSYS 0 (job 16923993438):
(chr 8364)is the character of code 172 – 8364 reduced to a byte, the windows-1252¬– so(ascii (chr 8364))is 172 and(vl-string->list (chr 8364))is(172);(ascii (chr 128))is 128. - BricsCAD V25, Windows, LISPSYS 0 (job 16923993442):
(chr 8364)is the euro, code 128 – its windows-1252 byte:(ascii (chr 8364))128,(vl-string->list (chr 8364))(128). - BricsCAD V26, macOS, LISPSYS 0 (job 16923993439): Unicode code points, 8364 throughout.
(strlen (chr 8364))is 1 on all three. Under LISPSYS 1 / 2 (AutoCAD 2021+, documented) codes are Unicode code points.
clautolisp
Characters are Unicode inside clautolisp; the dialect decides the CODE a character has and the character a code names – for chr, ascii, vl-string->list, vl-list->string, vl-string-elt, vl-string-position, read-char and write-char alike. Under an AutoCAD Windows dialect before 2021, or at LISPSYS 0, a code is reduced to a byte read as windows-1252; under a BricsCAD Windows dialect at LISPSYS 0, windows-1252 for the characters it has and Unicode beyond; otherwise Unicode code points.
Availability
- AutoCAD 2026: documented (per Autodesk reference page).
- BricsCAD V26: presumed compatible (no contradicting page found).
- Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.
Source Notes
- [ascii (AutoLISP)](https://help.autodesk.com/cloudhelp/2026/KOR/AutoCAD-LT-AutoLISP-Reference/files/GUID-03E1B586-72CB-4AB6-A151-B581AE530318.htm)
- Status: documented.