Path: utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!usc!jarthur!uunet!mcsun!sunic!dkuug!daimi!erja From: erja@daimi.dk (Erik Jacobsen) Newsgroups: comp.lang.pascal Subject: ELSE considered harmful :-) Message-ID: <5381@daimi.dk> Date: 26 Feb 90 08:49:42 GMT Sender: news@daimi.dk Reply-To: erja@daimi.dk (Erik Jacobsen) Organization: DAIMI: Computer Science Department, Aarhus University, Denmark Lines: 28 This is a valid part of a TurboPascal 5.0-program: CASE n OF 1: p := 7; 2: p := 6; 3: IF x = 4 THEN p := 5; ELSE p := 4; END What's wrong? Well, I guess you spotted it. The ELSE is an ELSE in the CASE- statement, and not in the IF-statement, as the indention suggests. And the error is the semicolon at the end of "p := 5". It bit me yesterday ... I would prefer if the CASE-ELSE had been OTHERWISE. Erik -------------------------------------------------------------------- Erik Jacobsen, Computer Science Department, Aarhus University Ny Munkegade, Building 540, DK-8000 Aarhus C, Denmark Phone: +45 86127188, Telefax: +45 86135725, Home phone: +45 86169199 Internet: erja@daimi.aau.dk, Ham-radio: OZ6KS