If-elseIf-else-endIf

Conditional branching. Syntax:

  • If Expression1 Then
    • Program code when Expression1 = TRUE and Expression2= TRUE
  • elseIf Expression2 Then
    • Program code when Expression1 = TRUE
  • elseIf Expression3 Then]
    • Program code when Expression1 = TRUE and Expression2 = TRUE
  • [else]
    • Program code when Expression1 = FALSE and Expression2 = FALSE
  • endIf

Example

  dim a,b as byte
  if a>b or a=100 then
    [..]
  elseif b=1000 then
    [..]
  elseif b=2000 and meineFunktion(a+b) then
    [..]
  else
    [..]
  endif