VERY VERY interesting, Stargate!
It is an excellent start-idea.
a Macro is not a function (procedure).
Macros are create on compile time, not on run time.
So you can't evaluate it!
I know, hence my question...

I don't think I can do a Goto Label_2 with a Procedure.
The "little surprise" I was trying to make, is the insertion of the Gosub in the procedures. Gosub exists in PB, but works only in the main program, outside the procedures.
I am trying that because I am missing the Gosub. Of course, I can use procedures for repeating operations, but then I need to bring all the variables to that procedure, and that's often a lot of work. The only solution is of course to use Goto.
Stargate, maybe you can help? Because I don't know Assembler at all.
Here is the basic idea:
Code: Select all
Macro Gosub(x,y)
Back.s=Eval(y)
Goto x
EndMacro
Macro Return()
Goto Back.s
EndMacro
Debug "Start!"
Gosub(SubVerify,Cont) : Cont: : Debug "Continue the program after GOSUB"
End
SubVerify:
Debug "Verification routine..."
Return()
You see here that the problem is the Back.s variable. I need to evaluate the value of Back.s, in order to return to the label Cont:, when the subroutine is done.
Sure, we must then think further, because we can have nested Gosub's....