If Sample

' These are samples for keywords of If statement.

' If - Then - EndIf

If 3 < Math.Pi Then
  TextWindow.WriteLine("3 < π")     ' 3 < π
EndIf

' Else

n = 1
If 0 < n Then
  TextWindow.WriteLine(n + " > 0")  ' 1 > 0
Else
  TextWindow.WriteLine(n + " ≦ 0")
EndIf

' ElseIf

n = -1
If 0 < n Then
  TextWindow.WriteLine(n + " > 0")
ElseIf n = 0 Then
  TextWindow.WriteLine(n + " = 0")
Else
  TextWindow.WriteLine(n + " < 0")  ' -1 < 0
EndIf

Popular Posts