User Tools

Site Tools

한국어

wikiblog:cublocstydy9:index

If...Then...ElseIf…EndIf

You can use If…Then…ElseIf…Else…EndIf conditional statements to control execution of your program.

  If Condition1 Then [Expression1]
      [Expression2]
  [ElseIf Condition2 Then
      [Expression3]]
  [Else
      [Expression4]]
  [End If]

Usage 1

If A<10 Then B=1 

Usage 2

If A<10 Then B=1 Else C=1

Usage 3

If A<10 Then ' When using more than 1 line,
    B=1 ' do not put any Expressions after "Then".
End If

Usage 4

If A<10 Then
    B=1
Else
    C=1
End If

Usage 5

If A<10 Then
    B=1
ElseIf A<20 Then
    C=1
End If

Usage 6

If A<10 Then
    B=1
ElseIf A<20 Then
    C=1
ElseIf A<40 Then
    C=2
Else
    D=1
End If

Charles's Blog

wikiblog/cublocstydy9/index.txt · Last modified: 2022/06/23 06:03 by COMFILE Technology