For my new 'PLC' program, i have a lot of condition code ...
I'm looking for a correct way to exit a [condition]
is a [GOTO] allowed to exit a [IF] or [SELECT] condition ?
is the [Break] command only for [For ... Next] loop ?
I use this method in 68K ASM/BASIC but do it works with PB ?
OS: win 10
PB: 5.73 LTS x64
Q1)
Is this correct way ?
(this as a very simply example)
Code: Select all
Global A.l
Global B.l
Global C.l
A = 1
B = 2
C = 0
LabelA:
If A = 1
Goto LabelB
ElseIf A = 2
Goto LabelC
Else
Goto LabelD
EndIf
End
LabelB:
Do some stuff
Debug Str (A)
A = A + 1
Goto LabelA
LabelC:
Do some stuff
Debug Str (A)
A = 0
Goto LabelA
LabelD:
Do some stuff
Debug Str (A)
A = 1
Goto LabelA
Q2)
Same question for a [Select] condition ?
Code: Select all
LabelA:
Select A
Case 1
Goto LabelB
Case 2
Goto LabelC
Default
Goto LabelD
EndSelect
End
LabelB:
Do some stuff
Debug Str (A)
A = A + 1
Goto LabelA
LabelC:
Do some stuff
Debug Str (A)
A = 0
Goto LabelA
LabelD:
Do some stuff
Debug Str (A)
A = 1
Goto LabelA
Marc



