Rhinoscript:local control flow
From ksteinfeWiki
Contents |
Decision Structures
If-Then
If SomethingOrOther Then
DoSomething()
End If
If-Then-Else
If SomethingOrOther Then
DoSomething()
Else
DoSomethingElse()
End If
Select-Case
Dim number : number = 8
Select Case number
Case 1
Print("one")
Case 8
Print("eight")
Case 10
Print("ten")
Case Else
Print("else")
End Select
Try-Catch-Finally
TODO:
Loop Structures
Do
Dim x
x=0
Do
DoSomething()
x=x+1
If x>10 Then Exit Do
Loop
While
Dim x
x=0
Do While x>10
DoSomething()
x=x+1
Loop
For
Dim i
For i = 0 To 10
DoSomething()
Next
For-Step
Dim i
For i = 0 To 10 Step 2
DoSomething()
Next
For i = 0 To 10 Step 2
DoSomething()
Next
