The AutoCADET's Guide to Visual LISP: Optimize and Customize Your AutoCAD Design Environment

The most common type of data you will use when writing programs is the string type, which consists of a string of characters. Strings can carry an assortment of data, most of which is coming in from or going out to the user. Input and output is a key element of any program. In this chapter, you explore how strings are stored, created, joined, torn apart, and converted.
Visual LISP treats all strings as equals. Whether a string is empty or many characters long, the operations remain the same.
To create a string constant, you simply supply a string between quotation marks ( ") in the appropriate place in the program. Your string can be any length, although you might want to keep it within reasonable limits for printing. Strings are created also by when they are read from a file, input by the operator, obtained from dialog boxes, or the result of a conversion from another data type.
To save a string, you use a SETQ expression and giving the string a symbol name. Strings are stored on the stack or the heap, depending on where the symbol is defined. It is a good idea to keep strings from growing too large to minimize the amount of stack or heap space used. If your program is running out of memory, you probably have too many strings in use. There are two recurring themes to memory problems and strings.
It may be that the stack is...