Hello, I am currently writing a widget for a trading system and have run into a bit of an issue passing variables to a textbox within the widget.
My integer variables in the passage are _NumGeneral, _NumSurgery and _NumPharma and the widget is called with "General", "Surgery" or "Pharma" as $args[0].
Is it possible to write a generalized case within the widget for something like <<textbox "'_Num'+$args[0]" _Num+$args[0]>>, or will I need 3 separate widgets instead?
Comments
Something like this might work (untested):
Alternatively you could change the way you're calling your widget to begin with (also untested):
It needed to be something like: Though, honestly, it would simply be easier to use the <<textbox>> macro directly at that point.
The only way using a widget here becomes simpler is if it's doing other duties as well and/or you're only going to invoke it with a single argument. For example: Usage:
I'm actually using the widget to control a textbox and a pair of buy/sell links, so I'm not too worried about calling extra args, and thanks to both of you it works now, albeit in a messy way.