Visual LISP uses color coding to help identify elements entered in the Console and text editor windows.
Elements entered might be a built-in AutoLISP function, number, or string. Color coding makes it easier to detect missing quotes or misspelled function names.
The Visual LISP text editor provides color coding for AutoLISP, DCL, SQL, and C++ language source files. The color coding used in the Console and text editor windows is determined by a file's type, which is based on the file’s extension. You can change the color coding style associated with a file type by clicking Tools Window Attributes
Syntax Coloring from the Visual LISP menu bar. All text entered in the Console window is treated as AutoLISP code.
The default color scheme is shown in the following table.
Default color coding scheme for AutoLISP code |
|
---|---|
Color |
AutoLISP language element |
Blue |
Built-in functions and protected symbols |
Magenta |
Strings |
Green |
Integers |
Teal |
Real numbers |
Magenta, on gray background |
Comments |
Red |
Parentheses |
Black |
Unrecognized items (for example, user variables) |
The following coding example shows the advantages of using color coding to identify errors in AutoLISP code.

The previous illustration shows an AutoLISP program with standard color coding applied. With the color coding applied, you can identify the following problems:
- Built-in AutoLISP functions such as setq, defun, getdist, and getpoint are displayed in blue. The second instance of the getpoint function is misspelled, it is spelled as gtpoint and as a result of the misspelling it is shown in black. Elements that Visual LISP does not recognize are displayed in black.
- The use of the iff function in the example is also incorrect since it is not shown in blue. The correct name of the function used should have been if.
- Strings are displayed in magenta and are delimitated with a double quotation mark in the beginning and at the end. In the example, you can see that one of the double quotation marks is missing as all of the text following the string value appears in magenta. Adding the missing double quotation mark after the text will correct the problem.