Re: CASE...ENCASE Query...



On Jan 9, 2:47 pm, Steve Drain <st...@xxxxxxxxxxx> wrote:
More like C ATM, just the current loop. As loops are not labelled in
BASIC you could only chose one of nested NEXT/REPEAT/WHILE,
which would not be much more use.

The 'EXIT FOR variable' syntax is supported by BBC BASIC for Windows
(and a number of other BASIC dialects) which allows you to jump out of
an arbitrarily-deeply nested set of FOR loops:

FOR I% = start% TO finish%
FOR J% = first% TO last%
FOR K% = beginning% TO end%
...
IF bool% THEN EXIT FOR I%
...
NEXT
NEXT
NEXT
REM Execution continues here

Ah! But that is another form of comment. The point of using
VDU: at the start of a line is that it is executed in debuggin
mode, but can be easily removed to make a release version.

VDU: results in a 'Syntax error' in BBC BASIC for Windows!

I always recommend the *| method (the BB4W cruncher deliberately
*doesn't* treat that as a REM; it considers it a 'non-removable
comment' for debugging purposes).

Richard.
http://www.rtrussell.co.uk/
To reply by email change 'news' to my forename.
.



Relevant Pages

  • Re: Report enhancements
    ... My point about PERFORM UNTIL EXIT is that I can certainly see the potential ... implementor, which potential doesn't exist for the PERFORM UNTIL FALSE case. ... providing the syntax with no ambiguities whatever. ...
    (comp.lang.cobol)
  • Re: Report enhancements
    ... EXIT PERFORM format would be a syntactic problem. ... The object code has a problem figuring out whether the> statement is executed under control of a PERFORM by examining the stack at> execution time ... ... >>> You are using semantics rather than syntax. ... > in CONDITION-1 being FALSE; there may be any number of FALSE values. ...
    (comp.lang.cobol)
  • Re: Report enhancements
    ... > stack at execution time. ... All our compilers need to generate for out-of-line EXIT PERFORM is DUPL, ... syntax but for functionality otherwise unavailable. ... in CONDITION-1 being FALSE; there may be any number of FALSE values. ...
    (comp.lang.cobol)
  • Re: Infinite Loops and Explicit Exits
    ... As the person who wrote the initial proposal to add EXIT PARAGRAPH/SECTION ... Currently the EXIT PARAGRAPH/SECTION syntax can cause VERY unexpected results if ... > For those who have been following the "perform forever" and "exit perform> " threads, I'm just tidying up the first drafts of two proposals that> I hope to submit Real Soon Now to INCITS/J4 for evaluation and consideration> for a future standard, if nothing else so that they can be added to the> "candidates list" for future consideration. ... > One of these proposals relaxes the current restriction that an EXIT PERFORM> or EXIT PERFORM CYCLE statement may only appear within a PERFORM ... ...
    (comp.lang.cobol)