Subroutince/Function newbie question
LuXo12
Posts: 31
Hi everyone I am a n00b so I don't know if that would work or if that is even possible
I am trying to use a subroutine several times in a row and I was wondering if I could do some thing like 3 X GoSub_ONOFF
Here is what i mean:
Instead of writing
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
for x number of times could i do something like?
5 x GoSub_OnOff
and get the same result?
Thanks for help
I am trying to use a subroutine several times in a row and I was wondering if I could do some thing like 3 X GoSub_ONOFF
Here is what i mean:
Instead of writing
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
GoSub_OnOff
for x number of times could i do something like?
5 x GoSub_OnOff
and get the same result?
Thanks for help
Comments
You could write
where i is declared as a nib or byte.
Read the PBasic Manual in the chapters on the FOR statement
and the GOSUB statement.