Help please I dont understand

Hello again :smiley:

please,i dont understand this
I have a MBB with atom pro 28, I made the following code:

main index2 =3 for index=0 to 3 gosub MOVI(index) nap index2 next
I have 4 subroutines called “u”, “x”, “t”, “a” and MOVI sword (4) has the letters “u”, “x”, “t”, “a”
Sub u
;--------
sub x
;--------
sub t
;--------
sub a
;--------

but it gives the following error
Error: Expected Label

Gosub does not accept a variable?
if no, what I can do?

please help me :frowning: :cry: :cry:

Perhaps use the “BRANCH” command?

I dont remember the exact syntax, but this seems shorter and better:

main 
  FOR index = 0 to 3 
      BRANCH index 
  NEXT

GOTO main

Here is a trick for using branch to handle subroutines.

[code]i var byte

main
for i = 0 to 3
gosub branchsub
next
goto main

branchsub
branch i,
return ;need this return just incase i is ever larger then 3

U
;do stuff
return ;returns to next line after gosub branchsub

X
;do stuff
return ;returns to next line after gosub branchsub

T
;do stuff
return ;returns to next line after gosub branchsub

A
;do stuff
return ;returns to next line after gosub branchsub[/code]

Ah ha!

That’s the perfect solution, make the BRANCH routine part of a sub routine!

I’m marking this one down in my book of tricks. 8)