Hey guys I’m trying to get something working. I’m not sure if zscript supports structure like this. but I want I want to use a routine to call another routine using a variable.
The idea is that I have 2 routines. One where it will prepare my loop to go. And will have some extra checks later on. for visibility and folder stuff.
I don’t want to copy paste these conditions all the time. So I want to have one routine to check if the actions should be executed(actions being the second routine. PolypaintEnable or Test)
[IButton, "PolyPaint","enable polypaint",
[RoutineCall, RoutineCaller, "PolypaintEnable"]
]
[IButton, "Test","Test for testing",
[RoutineCall, RoutineCaller, "Test"]
]
[RoutineDef, RoutineCaller,
[RoutineCall, Prep]
[loop, [SubToolGetCount],
[RoutineCall, [VarLoad, routineToCall]] //problem here routinecall won't accept variable
[RoutineCall, NextSubtool]
]
[RoutineCall, LastSubtool]
,
routineToCall
]
[RoutineDef, PolypaintEnable,
[IPress,Tool:Polypaint:colorize]
]
[RoutineDef, Test,
[Note, "TestNote"]
]
Now in my mind this should work fine. But | [RoutineCall, [VarLoad, routineToCall]]
| Is not accepting a varload. Is there any work around for this to still work?