PDA

View Full Version : FOR and WHILE combined



marcuslee
23-11-2009, 04:54
You know, I'm learning so much by trying to write these tutorial articles. I'm still researching the Looping article, which has turned out to be very interesting. I was reading the HELP on FOR/NEXT loops and I saw that you can combine the FOR loop with a WHILE or UNTIL clause. And, I got to thinking ... I know, a dangerous hobby! :diablo: Anyway, I can't find any other language that has this complex construction. Eros, how did you think of this? :violent:

Oh, and one other question about this subject: when might you want to use this?

Mark 8)

Petr Schreiber
23-11-2009, 08:37
Hi Mark,

the tuned syntax with while/until was suggested by user. It was present in some older BASICs, but fact is not many languages feature this syntax currently.

I find it to be interesting way to avoid conditional tests inside loop.

ErosOlmi
23-11-2009, 09:12
This was the thread: http://community.thinbasic.com/index.php?topic=179.0
The Basic was UniBasic.
This is the manual: http://publibfi.boulder.ibm.com/epubs/pdf/29916600.pdf


PS: keeping forums and posts organized let you find anything (or almost anything ;) ).

marcuslee
23-11-2009, 15:29
This was the thread: http://community.thinbasic.com/index.php?topic=179.0


I searched before I asked the question. That thread either didn't come up or I didn't see it for what it was. After all, my question wasn't the main topic of the thread. It's pretty cool how y'all were trying to figure out how to do one thing (EXIT multiple FORs) and something indirectly related came to the fore as well. :occasion:



The Basic was UniBasic.


What's really cool about Basic is that everyone has a version because it is so darn easy to use. thinBasic is still the best! :eusadance:



PS: keeping forums and posts organized let you find anything (or almost anything ;) ).


Well, hopefully next time someone searches for FOR and WHILE like I did, this thread will come up. That's why I try to pick a subject line that directly correlates to the topic. It's better organized that way.



Mark

ErosOlmi
23-11-2009, 16:42
Well, searching this forum with so many posts is not easy especially when you search for keywords because they can be in so many posts.

There is a trick :D : I searched for "FOR" and "UNTIL" only in "Feature requests" (and child) forum because I remembered that it was inside a feature request.