Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!UCONNVM.BITNET!STEIN From: STEIN@UCONNVM.BITNET (Alan Stein) Newsgroups: comp.sys.apple Subject: Orca/Pascal Problem Message-ID: <9001142031.AA29194@apple.com> Date: 14 Jan 90 20:29:02 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 36 In the following Orca/Pascal procedure, the char variable 'c' read in on line {1} seems to be ignored in line {2}, where none of the alternatives are being executed no matter what keys I press for 'c'. The value for 'c' is being correctly printed in line {3}. I can't find anything wrong. Does anyone else see anything? procedure doarithmeticoperation; {perform an arithmetic operation mod m} var c:char; a,b,m,x:integer; begin writeln; writeln('Calculate a OP b MOD m'); writeln; write('Type in a: ');readln(a); write('Choose an operation -- a,s,m,e');readln(c); write('Type in b: ');readln(b); write('Type in m: ');readln(m); readln(c); {1} if (c='a') then x:= a+b MOD m {2} else if (c='s') then x:= a-b MOD m else if (c='m') then x:= a*b MOD m else if (c='e') then x:= raise(a,b,m); writeln;writeln('(',a,')',c,'(',b,') = ',x,' mod ',m); {3} end {doarithmeticoperation}; Alan H. Stein | stein@uconnvm.bitnet Department of Mathematics | University of Connecticut | Compu$erve 71545,1500 32 Hillside Avenue | GEnie ah.stein Waterbury, CT 06710 | SNET (203) 757-1231