For the first post. you can also use ASSOC
What you need to remember about COND that it will stop looking at the later conditions as soon as it finds one that is satisfied
you could write it this way
Code:
(if (setq fld4
(cond
((= a 10) (substr fld2 9))
((= a 11) (substr fld2 9))
((= a 12) (substr fld2 11))
((= a 13) (substr fld2 11 )))) fld4
(print "Drawing Number Format Unrecognized")
)
or
Code:
(if (setq fld4
(cond
((< 9 a 12) (substr fld2 9))
((< 11 a 14) (substr fld2 11))
)) fld4 (print "Drawing Number Format Unrecognized")
)
Notice there's only one call to setq?
or even,....
Code:
(if
(setq data (assoc a '((10 9) (11 9) (12 11) (11 11))))
(setq fld4 (substr fld2 (cadr data)))
(print "Drawing Number Format Unrecognized"))
Specially usefull if you're only needing to assign a value to one variable
HTH