Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DO WHILE and DO UNTIL
#5
boriel Wrote:So WHILE is not "redundant" to me, but DO WHILE.

You're right: WHILE...END WHILE is more common. I said it's redundant only because a versatile DO...LOOP makes it unnecessary. But I'm not suggesting to remove it Smile

boriel Wrote:Also ZX BASIC support DO: ... : LOOP (which repeats forever).

Yes. By the way, I've just discovered that Beta Basic supports even this:

Code:
do while condition
...
loop until condition

It seems quite useful. Anyway I guess it's easier for the Beta Basic interpreter to let that a double condition than to forbid it. What do you think about letting both conditions in ZX Basic?

Beta Basic lacks END IF, so IFs cannot spread on several lines. But this trick can be used instead:

Code:
do while condition
...
loop until 1

boriel Wrote:Anyway, I will add support for FreeBasic DO...LOOP implementation to maintain compatibility, since this easies the portability between ZX BASIC and FreeBasic. :roll:

Great. The backward compatibility with Sinclair Basic and the forward compatibility with FreeBASIC make ZX Basic quite promising!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)