Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!sol.ctr.columbia.edu!ira.uka.de!fauern!faui43.informatik.uni-erlangen.de!immd4.informatik.uni-erlangen.de!bdhelm From: bdhelm@immd4.informatik.uni-erlangen.de (Bernd Helm) Newsgroups: comp.lang.pascal Subject: Re: TPascal-puzzle Keywords: puzzle,pascal,turbo Message-ID: <1991Jun25.133600.14369@informatik.uni-erlangen.de> Date: 25 Jun 91 13:36:00 GMT References: <1991Jun25.114723.5433@informatik.uni-erlangen.de> Organization: CSD., University of Erlangen, Germany Lines: 30 prknoerr@immd4.informatik.uni-erlangen.de (Peter Knoerrich) writes: >I once did some hard debugging on some Turbo-Pascal code looking somewhat >like this (wonder if someone is really interested in pascal puzzles !?!?): >var > confirm : boolean; > key : char; >begin > confirm := false; > key := '0'; > case key of > '1' : Menue1; > '2' : Menue2; > '3' : Menue3; > '0' : if confirm then > RequestExit; ^ your problem is this semicolon. It finish the if-construct. The 'else' below belongs to 'case key of'. Test it with: key := 'A' or something else > else > FastExit; > end; >end; Ciao Bernd