[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnubol: How do we parse this language, anyway?




Bob,

> I have a question about simple nesting. Did the 'old' compiler which you
> are still currently using allow arithmetic statements on the end of
> conditionals at all.  As in
> 
>    ADD a TO b
>        ON SIZE ERROR
>             ADD 1 TO  error-count
>    .

It parses that just fine, and it seems to work correctly.

> Did the old compiler allow nesting of conditionals to the second level
> 
>    ADD a TO b
>        ON SIZE ERROR
>             ADD 1 TO  error-count
>                ON SIZE ERROR
>                   ADD 1 TO emergency-counter
>    .
> 
> Do we get warnings, silence, rejects; What?

That generates the following error:

ILA4086I-C    ERROR CONDITION USED WHERE ONLY IMPERATIVE STATEMENTS
              ARE LEGAL MAY CAUSE ERRORS IN PROCESSING.

> Without wanting to put demands on your time in terms of research, from
> your experience alone is there any difference in rules if the
> conditionals are nested inside of other conditionals? As in
> 
>    READ ....
>        AT END
>           ADD 1 to crazy-eof-counter
> .
> 
> Where crazy-eof-conter might be the means to control PERFORMS, who
> knows.

That's fine; I use a similar technique fairly often actually.

> Or more dramatically
> 
>    READ ....
>        AT END
>           ADD 1 to crazy-eof-counter
>              ON SIZE ERROR
>                 DISPLAY 'we must have been here a large number of times'
> .

This generates the same error as above.

> There isn't one of these I would recommend. I am actually just making a
> little more hunt for any mainframe model that may have lead PC or midi
> products to try to accept inner conditionals as positive extension.

Well, this isn't it!  I was actually surprised that this latter one
didn't work ... but it saves Me the time and trouble making that mistake
in the future, at least.  Nested IF statements are no problem (although
I'm not sure how deep the nesting can go; at least 36, since that's
where I stopped trying).


-- 
David R. Ondrejko - EDI/Referral - Safelite Glass Co.
 Mathematician by training - Programmer by trade - Philosopher by nature
 Genius by genetics - Atheist by conviction - Hedonist by desire!

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.