if...then...else (reserved words)

Language:
Русский
English

  if...then...else (reserved words)


If, then, and else specify the conditions under which a statement will be executed.

Syntax

 if expr then statement

OR

 if expr then statement else statement

Remarks

If the Boolean expression after if is True, the statement after then is executed.

Otherwise, if the else part is present, the statement after else is executed.

Example

 (* "if" statements *)
 if (I < Min) or (I > Max) then I := 0;

 if ParamCount <> 2 then
 begin
   WriteLn('Bad command line');
   Halt(1);
 end
 else
 begin
   ReadFile(ParamStr(1));
   WriteFile(ParamStr(2));
 end;

Тэги: if then
| G+
Код для вставки: :: :: :: ::
Поделиться: // //