Special Form Entry: VLAX-FOR
← Prev | ↑ Chapter | Next → | Index | Symbols
Special Form Entry: VLAX-FOR
Name
vlax-for
Class
Special Form
Syntax
(vlax-for var collection [expr ...])
Description
Iterates over an ActiveX collection object.
Compatibility
- Autodesk classifies
vlax-foras a special form - Windows-only in Autodesk documentation because it depends on ActiveX support
Notes
This construct belongs to the Visual LISP / ActiveX layer, not the core portable AutoLISP layer.
The loop variable — not specified
Neither Autodesk's page nor this entry says what happens to var: no
statement that it is bound, none that it is assigned, and none about
whether it survives the loop. The corresponding wording for foreach
does say "bind it to name", and both AutoCAD and BricsCAD were measured
to bind (see that entry) — but that is foreach, and it does not carry
over by itself.
No vendor evidence exists for vlax-for specifically. Obtaining it
needs a live ActiveX collection, which a headless probe cannot conjure;
it belongs with the manual vendor-probe jobs.
clautolisp
Binds, using the same rule as foreach — one function serves both, so
the two loops cannot drift apart. This is asserted by analogy, not
measured: two loops in one implementation disagreeing about their own
loop variable is far likelier to be an oversight than an undocumented
vendor behaviour.
Until 2.0.26 clautolisp assigned here when the name was already bound
further down the dynamic chain, so a vlax-for over a name a caller had
bound wrote that binding and left the last collection member in it.
That was the code foreach carried until AutoCAD was probed, and
vlax-for had simply been left behind when it was corrected.
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. The loop-variable rule is unverified on both hosts — see above.
Source Notes
- [About Special Forms (AutoLISP)](https://help.autodesk.com/cloudhelp/2017/ENU/AutoCAD-AutoLISP/files/GUID-F992EAA3-AFFC-425D-B7C9-6A9CB0EA2768.htm)
- [AutoLISP Extensions Reference (AutoLISP/ActiveX)](https://help.autodesk.com/cloudhelp/2026/KOR/AutoCAD-LT-AutoLISP-Reference/files/GUID-07C3599E-EC87-4EC0-8F0B-8DE4BD150A64.htm)
- Status: category documented; detailed semantics tied to ActiveX collections.