Yes, topic was a little vague.
Do you wish to have this string "remember from last time"?
For example, remember the last entered destination layer name
for a custom CHPROP command (/ ENTMOD).
There are several methods for storage and retrieval of declared variables.
a) The Gremlin. Let's call it variable 'd' as in (setq d "AHA!")
Do not declare the variable in the opening line: (defun c:LC ( / a b c)...
where 'a' 'b' 'c' are cleared when program ends. I have a habit of using
a prefix to the command name: (setq USER_LC "AHA!"). This variable is
session only, running loose, and will go away when the editor is closed.
More than likely this variable is structured as a LIST. Don't worry, lists are
easy to manipulate as compared to other languages (ARRAY).
b) The drawing file's dictionary, specifically VLAX-LDATA-GET and VLAX-LDATA-PUT.
This is used for drawing-specific data (an example would be DWGPROPS
information). Again, a LIST is possible.
c) The Registry. Generally used for user-specific settings. VL-REGISTRY-READ
and VL-REGISTRY-WRITE. An example is to restore OSMODE to a value that
you desire due to a poorly/incomplete written program.
d) Some sort of external file such as INI-structured. One will have to create
a custom parser as I do not believe there is one built in that will read this.
e) Obsolete: acad.CFG configuration (INI) file. This is a pre-registry method
I believe still works, but is no longer preferred.
However, it looks like you are having issues with STRCAT.
If that's the case, never mind...
In it's simplest form:
(setq a "")
(while (setq b (cdr (assoc 1 (entget (car (entsel "Select a text object: "))))))
(setq a (strcat a (if (> (strlen a) 0) "-" "") b))
);while
(alert a)
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.