Symbols and Variables

AutoCAD AutoLISP & Visual LISP

 
Symbols and Variables
 
 
 

AutoLISP uses symbols to refer to data. Symbol names are not case sensitive and may consist of any sequence of alphanumeric and notation characters, except the following:

Characters restricted from symbol names

(

(Open Parenthesis)

)

(Close Parenthesis)

.

(Period)

'

(Apostrophe)

"

(Quote Symbol)

;

(Semicolon)

A symbol name cannot consist only of numeric characters.

Technically, AutoLISP applications consist of either symbols or constant values, such as strings, reals, and integers. For the sake of clarity, this guide uses the term symbol to refer to a symbol name that stores static data, such as built-in and user-defined functions. The term variable is used to refer to a symbol name that stores program data. The following example uses the setq function to assign the string value "this is a string" to the str1 variable:

_$ (setq str1 "this
is a string")
"this is a string" 

Help yourself and others who need to read your code. Choose meaningful names for your program symbols and variables.