System Variable Entry: ERRNO
← Prev | ↑ Chapter | Next → | Index | Symbols
System Variable Entry: ERRNO
Name
ERRNO
Type
integer
Default
0
Read-Only
yes
Scope
session; saved in not saved
Description
Displays the number of the appropriate error code when an AutoLISP function call causes an error that the product detects.
Read/Written By
- entget
- entmake
- entmod
- entsel
- findfile
- load
- nentsel
- open
- read-line
- ssget
- ssname
- tablet
- write-line
- xdsize
Compatibility
AutoCAD and BricsCAD. AutoCAD all; BricsCAD V20+. Divergence: type AutoCAD Integer, BricsCAD Short.
Tested Behaviour
Although both vendors document ERRNO as read-only, (setvar "ERRNO" 0)
is ACCEPTED by AutoCAD 2022 (accoreconsole), BricsCAD V25 (Windows) and
BricsCAD V26 (macOS): (getvar "ERRNO") then gives 0 until the next
failing builtin sets it again (error-processing catalogue,
probes/error-processing/, 2026-11-03).
Source Notes
clautolisp
clautolisp implementation note – not part of the normative specification
above. Since clautolisp 2.3.85, (setvar "ERRNO" n) writes the session
errno and returns n in every dialect, as the products do (before, it
signalled "Sysvar ERRNO is read-only"). Being an undocumented tolerance
that every engine has, it is flagged by the [errno-setvar] notice –
once per run, under --dialect autocad, --dialect bricscad and
--strict (pjb, 2026-11-03); --clautolisp and --lax are silent. The
same treatment as [vl-catch-all-apply-arity]
(errno-setvar-accepted-by-vendors).