Else

From Lazarus-ccr

Jump to: navigation, search

Else is keyword which introduces the action to do if the condition is false.

[edit] If then else

 
  if (condition)
  then (action)
  else (action);
 

[edit] More statements in "if then else" statement

If you need two or more statements in "if then else" statement. In that case, you need the begin ... end around the statements.

 
  if boolean_condition then
    begin
      statement_one;
      statement_two;
    end 
  else
    begin
      statement_three;
      statement_four;
    end;
 



Keywords: begindoelseendforifrepeatthenuntilwhile