Breaking out of dolist...

Q&A's, tips, howto's
Locked
Sunburned Surveyor
Posts: 28
Joined: Thu Jan 13, 2005 12:42 am
Location: California
Contact:

Breaking out of dolist...

Post by Sunburned Surveyor »

Is it possible to break out of a dolist loop before all of the elements in the subject list have been iterated through?

For example, I want to use dolist to manipulate each element in a list until I reach an element with a certain value. Is this possible?

What syntax would I use to break out of a dolist or other loop in NewLISP?

I checked the NewLISP manual, but I couldn't find a "break" statement that is common to other languages.

The Sunburned Surveyor

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

See the (dotimes ...) example in the Throw section of the help file.
-- Sam

Locked