Danaher Motion
06/2005
Appendix A
M-SS-005-03 Rev
E
165
APPENDIX A
S
AMPLE
N
ESTING
P
ROGRAM
Dim Shared I1 As Long
Dim Shared I2 As Long
Dim Shared I3 As Long
Dim Shared I4 As Long
Dim Shared I5 As Long
Program
Do
If I1=0 Then 'First If...Then
If I2=0 Then 'Second If...Then
While I3<5 'First While
Print ""
Print "*******I3=";
?I3
I3=I3+1
For I4=1 to I3 Step 2 'First For statement
Print "I4=";
?I4
For I5=I4 to 10 'Second For statement
Print "I5=";
?I5
Sleep 50 'To slow task down
Next I5
Next I4
End While
End If
Else
I3=0
While I3 <=5 'Second While
I3=I3+1
Select Case I3
Case 1
Print "I3=1"
Case 2
Print "I3=2"
Case 3
Print "I3=3"
Case Else
Print "I3 is not 1, 2, or 3"
End Select
End While
End If
I1=I1+1
Loop Until I1>1
End Program