Code: Select all
repeat with i = 1 to 10
#do step a
if i = 5 then next repeat
#do step b
end repeat
First question: is there something in newLISP to do this? I didn't see it in the documentation. If there is then ignore the rest of this message. ;-)
If there isn't, I think I see how to do this in a macro. It would take the above and change it to something like:
Code: Select all
repeat with i = 1 to 10
#do step a
if not (i = 5) then #do step b
end repeat
But what if the code looks more like this:
Code: Select all
repeat with i = 1 to 10
#do step a
if i > 3 then
#do step b
if i < 8 then
#do step c
if i = 5 then next repeat
#do step d
end if
#do step e
end if
#do step f
end repeat
Code: Select all
repeat with i = 1 to 10
#do step a
if i > 3 then
#do step b
if i < 8 then
#do step c
if not (i = 5) then #do step d
end if
if not (i = 5) then #do step e
end if
if not (i = 5) then #do step f
end repeat