-
subroutine question
i want to create a selection that automaticly goes into the right sub menu
for example is counter=1 then gosub routine1, counter=2 then gosub routine2, counter=3 then gosub routine3 etc.
something like this:
main routine:
counter=counter+1
'do whatever i wanna do
gosub routine(counter)
'and on
goto main
routine1:
'do 1st:return
routine2:
'do 2nd:return
routine3:
'do 3th:return
can this be done simple in picbasic, so i can keep my main program short !
thanx allready for your ideas and suggestions
-
use BRANCH or BRANCHL. But don't forget, it's multiple goto, not gosub.
OR use SelectCase
Code:
Select Case Counter
Case 1 : Gosub Routine1
Case 2 : Gosub Routine2
Case 3 : Gosub Routine3
'
'
End Select
-
thanx for helping my on the way again,
i tested with BRANCH and it works