Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Mentor
southie
Posts: 291
Registered: ‎03-15-2007
Message 1 of 3 (309 Views)

Ending a foreach loop

309 Views, 2 Replies
10-03-2012 07:34 AM

Hi Gang

 

(defun stopx ()
(setql ww nil)
)

(setq ww  '("3AF4" "3AF7" "3AFA" "3AFD" "3B00" "3B03" "3B06" "3B09" "3B0C"))

 

Can one stop a (foreach  n ww .......

loop that calls a dialog box and user chooses cancel in the middle of loop (action_tile "cancel" "(stopx)(done_dialog)")

 

does not seem to be workin.

 

Thanks

Southie

*Expert Elite*
dgorsman
Posts: 5,611
Registered: ‎10-12-2006
Message 2 of 3 (294 Views)

Re: Ending a foreach loop

10-03-2012 09:52 AM in reply to: southie

No.  Switch to (while...) so you can add conditional testing.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Mentor
southie
Posts: 291
Registered: ‎03-15-2007
Message 3 of 3 (290 Views)

Re: Ending a foreach loop

10-03-2012 10:03 AM in reply to: dgorsman

Thanks dgorsman & nice to see you helping again!

 

Southie

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!