|
|
IF.THEN.ELSE YAPISI
Yapısı:
IF <koşul> THEN <doğru olduğunda çalışacak kod> ELSE <yanlış olduğunda çalışacak kod>;
IF yapısı true ya da false değerinden birisini döndürür.
Örnek:
If yasi >= 18 then
yetiskin:=true
else
yetiskin:=false;
Basit bir koşul için tek parçalı bir IF yapısı yeterlidir:
Örnek:
If sonuc=true then
exit;
Örnek:
If yasi>=18 then
Begin
yetiskin:=true;
ucret:=1000;
end
else
Begin
yetiskin:=false;
ucret:=500;
end;
balıkesir.edu.tr