Sign in Join
Wiki copytemporary

Revision 1 of 3, by WikiArchive on 11-4-2026. The page as it is now.

If/fr

Ce mot-clé précède une condition, et doit être suivi par then et éventuellement par else.

If then

pascal
if condition
        then true_statement
        else false_statement;

Condition est une expression Boolean évaluée à true or false. true_statement est exécuté si condition est évaluée à True. false_statement est exécuté si condition est évaluée à False. Une erreur de compilation survient si la condition ne donne pas une valeur booléenne.

Plus d'instructions dans l'instruction "if then"

Si vous avez besoin de plus d'une instruction pour true_statement ou false_statement, placez-les dans un bloc begin ... end.

pascal
if boolean_condition then
        begin
          statement_one;
          statement_two;
          statement_three;
        end;

Documentation

Documentation officielle : 1(http://www.freepascal.org/docs-html/ref/refsu58.html#x163-18500013.2.3)

Mots-clés: begin — do — else — end — for — if — repeat — then — until — while


From the Free Pascal wiki, page "If/fr", as the Internet Archive kept it on 2025-02-06. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.