Il Razziatore wrote:
> CBFalconer wrote:
>
>> Commands := ['L', 'P', 'l', 's', 'r', 'd'];
>
> [ cut ]
>> IF NOT (option IN commands) THEN BEGIN
>> writeln('Unknown option');
>> menu;
>> END
>> ELSE
>> CASE Option OF
>> (* Remove those empty parens, Pascal is not C *)
>> 'L' : yylex;
>> 'P' : yyparser(Tokens);
>> 'l' : Menu;
>> 's' : Menu;
>> 'r' : Menu;
>> 'd' : Menu;
>> END; (* CASE, ELSE *)
>
> Why you do that? You don't know the case statement can have else
> inside his?
It's a portability thing. ISO7185 Pascal doesn't have an OTHERWISE
clause for a case statement, that needs an ISO10206 compiler. Use
of ELSE for CASE defaults is a Borland misuse. The code I posted
will run anywhere that SET OF char is available.
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson


|