I assume you want to do this so you can change the procedure being called in a given expression at runtime?
Unfortunately, for this to work, you need a language that has either function pointers or first-class functions. Blitz3D doesn't support either of those things natively.
You can get really indirect support for function pointers using FastPointer, but be warned that that's really not aimed at beginners.
The best way to do what you want in B3D is to restructure your logic so that all procedures are called statically - that probably means putting an If or Select structure driven by a "function ID" tag around your call site.
EDIT: Also, unless there's a very specific reason, general advice is to avoid Gosub entirely, as it serves pretty much no useful purpose and encourages poor style.
Last edited 2011
|