Look attach file ,same as Doug comment.
"Doug Broad" wrote in message
news:5528283@discussion.autodesk.com...
What is newlisn? It doesn't get set in your code until you add it so the
effect is (+ 3
nil)
wrote in message news:5528267@discussion.autodesk.com...
G'dat Group,
I have posted my code below (I have butchered it somewhat) but have filled
in the missing
parts to still achieve the error.
If you cut and past this into the VLISP Editor and select it to run I get a
BLANK inspect
window returned??
But when stepped through step by step, inside the WHILE statement it all
works. (I have
replaced STR with the string for the purpose of the exercise).
What am I doing wrong?
(setq counter 0)
(setq selectlength 2)
(while (< counter selectlength);2 times
(setq STR "%%U3 - OPP. HAND - 012B");next time this runs through it will
change to "%%U2 -
AS DRAWN - 012A"
(setq POS1 (vl-string-position (ascii " ") STR));4 INTEGER
(setq POS2 (vl-string-position (ascii "U") STR));2 INTEGER
(setq newnumber (substr STR (+ POS2 2) (- POS1 3)));"3"
(setq newnumber (atoi newnumber)); THIS IS NOW AN INTEGER 3
(setq newlisn (+ newnumber newlisn))
(setq newlist (cons newnumber newlist))
(setq counter (1+ counter));COUNTER EQUALS 1 NOW
)