4.1. If - JulTob/Ada GitHub Wiki

If

If represents a conditional statement. It can be linked to multiple paths.

if Bool then
   --...--
end if;
if Bool then
   --...--
else
   --...--
end if
if Bool then
   --...--
elsif Bool_2 then
   --...--
end if
if Bool then
   --...--
elsif Bool_2 then
   --...--
elsif Bool_n then
   --...--
else
   --...--
end if
if Bool1 and Bool2 then
   --...--
end if;  
if Bool1 or Bool2 then
   --...--
end if; 
if not Bool then
   --...--
end if;
if Number = 2 then  --Value condition, is the same as a Bool
   --...--
end if;    
if Number < 2 then  --Value condition
   --...--
end if;  
if Number in 1 .. 10 then  --Value condition
   --...--
end if;  
If index = 21
  Then 
    myschool(index).age := 5;
  Elsif index in 99 .. 112
    Then 
      myschool(index).age := 6;
  Else 
    myschool(index).age := 7;
End if;
If (for some i of arr => arr(i) < 6) then rc:= true; end if;
If (for all i of arr => arr(i) < 6) then rc := true; end if;
if B < (A + C)
  then
    A :=2*A;e
end if;
if B < (A + C)
  then 
    A :=2*A;
  else
    A :=3*A;
end if;