News:

;) This forum is the property of Proton software developers

Main Menu

[Suggestion] WHILE / WEND condition

Started by sdallo, Feb 03, 2025, 04:08 PM

Previous topic - Next topic

sdallo

Hi,

speaking of the "WHILE" and "WEND" instructions, the manual indicates to insert a condition after "WHILE", so far so good, but I remember that in other BASICs it is possible to put the condition after "WEND" to execute the intermediate code once anyway and check AFTERWARDS if it is necessary to repeat.

I tried to insert the condition after "WEND" convinced that I had an error from the compiler, instead it finished the compilation without complaining... only that the process does not work as expected, remaining infinitely in the intermediate code.

I do not know if Les will have a way to modify this aspect or if it is not possible to implement this possibility, I am only limiting myself to reporting...

Thanks, Stefano


JohnB

Currently Positron Basic, as far as I know, does not support an additional condition after Wend to exit.  You will have to add a condition in your loop to break early.  The language supports Do...Loop {Until} and Repeat.. Until.  I suppose you could ask Les to consider add an optional {Until} after Wend but personally I think it is unecessary.
JohnB

sdallo

Thanks JohnB,

I agree, it is not necessary any modification to WHILE / WEND, I forgot to search the word UNTIL in the manual, found the REPEAT / UNTIL as you write and it solve my question.

Stefano