Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New beta release 1.2.6r1603b
#3
programandala.net Wrote:
boriel Wrote:This version just adds little improvements to the previous one:
  • Compatibility for DO UNTIL <cond>... LOOP and DO WHILE <cond> ... LOOP as programandala asked.

It seems it works fine. Thank you. Now the control flow can be more creative Smile and, the most important, ZX Basic's DO-LOOP is FreeBASIC-compatible.

What about allowing conditions both with DO and LOOP at the same time?:

Quote:Do [ { Until | While } condition ]
[ statement block ]
Loop [ { Until | While } condition ]

FreeBASIC doesn't allow that, but Beta Basic (for the ZX Spectrum) and SAM Basic (for the SAM Coupé) do, and I find it very useful: a loop with two exit conditions. Besides, the syntax in the documentation would be simpler: just the example above needed, not two Smile

Do you think it is feasible without much effort?
I think it does not worth the hassle. This especial case will require changing some compiling internals, and the generated code won't be very efficient (Eg. checking two conditions per loop cycle). What is the meaning of that instruction, BTW? I don't understand it very well... :roll:

If you need to check extra conditions within the loop, you can always use:
Code:
DO...
    IF <condition> EXIT DO: END IF
LOOP
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)