FreePascal Information Logo Friend of FreePascal Compiler Title
Articles with Feedback, FPC News Library, PDF Collection, Mail Lists, Books, Newsgroups, IRC Open online discussion areas Research and Tutorials Tools, Compilers and Utilities Blurbs about us, advertising, etc.
Welcome to the FoFPC Pascal Language ELSE

else


     The Else keyword is part of the If, Case and Try statements. It is used to start the section of code executed when earlier conditions are not satisfied.

Example

    Download Source IconDownload This Source for Free Pascal
Var
   int:Integer;

begin
  // Note the lack of a ';' after the 'then' clause
  if False then Writeln('True')
  Else Writeln('False');

  // Nested if statements - Delphi sensibly manages associations
  if true then
    if false then
      Writeln('Inner then satisfied')
    Else
      Writeln('Inner else satisfied')
  Else
    Writeln('Outer else satisfied');
   int := 6;
   case (int mod 2) of
      0:Writeln('Zero');
      1:Writeln('One');
      Else Writeln('Not 1 or 0');
   end;
end.

Output

False
Inner else satisfied
Zero

See Also

Case, End, If, Then, Try.
 Links and Products we find useful



ButtonGenerator.com
Valid XHTML 1.0 Transitional Internet Map
Programmer's Heaven
grat-i-fi-ca-tion - noun
the state of being gratified; great satisfaction.


"Your research documents are head on ... I look forward to seeing more notes on your research."

Brian Ellixson
FreePascal User
Locations of visitors to this page world map hits counter
Copyright 2009 by 3F, LLC. All rights reserved. Worldwide.
Your request was processed by server #3 in 0.001595 secs.

sponsor
Click to visit our paid sponsor