Sign in Join
Wiki copytemporary

If/fi

Deutsch · English · Français · Suomi · Русский · 中文(中国)

If avainsana edeltää ehtoa jota seurattava then ja lause (statement). Siinä voi olla myös else lause.

If then

pascal
if condition
    then true_statement
    else false_statement;

Yllä olevan condition on boolean tyyppinen ehto joka tuottaa true tai false arvon. Koodissa siirrytään true_statement jos condition tuottaa arvon true. Koodissa siirrytään false_statement suoritukseen jos condition tuottaa arvon false. Käännösaikainen virhe syntyy jos condition ei tuota boolean tyyppistä arvoa.

Monia lauseita if then haarassa

Jos tarvitaan kahta tai useampaa lausetta true_statement tai false_statement niin se saadaan kokoamalla ne begin…end lohkoon (koottu lause).

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

Katso myös


From the Free Pascal wiki, page "If/fi", as it stood on 2023-01-25 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. 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.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.