Ah. got it. Well, I'm very fuzzy on my lisp knowledge so let me tackle some of the higher level stuff and we'll see if you can't get this figured out.
1. I don't think you can use tablesearch to search for two layers like that. You may just have to search each layer one at a time.
2. Your IF statement is formatted incorrectly.
The proper format is:
so if you take a look at your structure, you'll see that the THENEXPR is just a simple SETQ and the optional ELSEEXPR is a command call. If you need to group those two statements (SETQ and COMMAND) into one expression you can use PROGN
thenexpr
subsiquent thenexpr
)
[elseexpr]
)
But keep in mind as your structuring your expressions not to fall into the trap of sloppy structure (akin to sloppy drafting) because often times when you have more TESTEXPRs that need to be met, a cleaner method is to use COND.
((testexpr)
result
)
((testexpr)
result
)
...
)
So, clean up that and we'll see if I can't do a crash course on SSGET.