Sets the value of a symbol or symbols to associated expressions
Supported Platforms: Windows and Mac OS
(setq sym expr [sym expr] ...)
Type: Symbol
The user-defined variable to assign expr to. This argument is not evaluated.
Type: Integer, Real, String, List, File, ads_name, T, or nil
An expression.
Type: Integer, Real, String, List, File, ads_name, T, or nil
The result of the last expr evaluated.
This is the basic assignment function in AutoLISP. The setq function can assign multiple symbols in one call to the function.
The following function call sets variable a to 5.0:
(setq a 5.0) 5.0
Whenever a is evaluated, it returns the real number 5.0.
The following command sets two variables, b and c:
(setq b 123 c 4.7) 4.7
setq returns the value of the last variable set.
In the following example, s is set to a string:
(setq s "it") "it"
The following example assigns a list to x:
(setq x '(a b)) (A B)