Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Ansi -iso > Re: READLN not ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 5 Topic 148 of 211
Post > Topic >>

Re: READLN not reading

by CBFalconer <cbfalconer@[EMAIL PROTECTED] > Mar 31, 2005 at 01:50 AM

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




 5 Posts in Topic:
READLN not reading
"Profetas" <  2005-03-30 10:21:17 
Re: READLN not reading
Hanford Carr <"hw  2005-03-30 10:53:42 
Re: READLN not reading
CBFalconer <cbfalconer  2005-03-30 16:51:59 
Re: READLN not reading
Il Razziatore <ilrazzi  2005-03-31 01:50:28 
Re: READLN not reading
CBFalconer <cbfalconer  2005-03-31 01:50:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:21:23 CDT 2008.