Diving into zscripting: Can I just check a couple of things about routines (scope, local variables etc)
In order to return a variable from a routine you need to use VarSet, rather than VarDef
Like the example below:
[IButton, “routine”, “doubles a number routine”,
[RoutineDef, double_it,
// doubles the given parameter
[VarSet, n, n*2]
,n]
// define num
[VarDef, myNumber, 4]
// call the routine
[RoutineCall, double_it, myNumber]
[Note, myNumber, 1]
]/End of ZScript/
Incidentally, in the zscript above, the number will continue to double each time you press the button. How do you reset this, so it only happens once?