It does not like the line:
Code:
task = GOSUB Task0, Task1, Task2, Task3, Task4
This is not a valid syntax for a GOSUB statement. A gosub can only go to one location. Also it does not return a value that can be assigned in this way. You can return values, but the syntax would be:
gosub x[], returnval
Also none of your subroutines appear to return anything. If your intent was to call all 5 of them you could:
Code:
gosub Task0
gosub Task1
...
If your intent was to call Task0 when Task=0, Task1 when Task=1... You could do it like:
Code:
IF Task=0 THEN
gosub TASK0
ELSEIF Task=1
gosub TASK1
...
or if this is the last thing you wish for the subroutine, you could use the branch statement
Code:
branch Task, [Task0, Task1, Task2, Task3, Task4]
; Task was not in range...
return
Task0:
...
return
Note in this method, the return in Task0 will not return to after the branch statement but instead to after the call to the function that contained the branch (I hope I am being clear here).
Good Luck
Kurt