Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!sun-barr!rutgers!cmcl2!adm!news From: fsbrn@BRL.MIL ( Ferd Brundick) Newsgroups: comp.lang.pascal Subject: Re: TPascal-puzzle Message-ID: <27298@adm.brl.mil> Date: 25 Jun 91 15:03:52 GMT Sender: news@adm.brl.mil Lines: 18 Haah, If your sample code is *exactly* what your program used, then the answer is simple. You have a semicolon after the THEN clause and that terminates the IF. The ELSE belongs to the CASE (as a default or none-of-the-above entry). If the Pascal you are using did not allow an ELSE on a CASE (it is an extension) then the compiler would have complained about an ELSE without an IF. IF/THEN/ELSE is a single complex statement, not a compound statement made up of substatements that have to be separated by semicolons. Overall, a ***very*** subtle bug. I prefer CASEs that use DEFAULT or OTHERWISE instead of overloading the ELSE verb. dsw, fferd Fred S. Brundick USABRL, APG, MD.