Can one action set 2 or more variables
May 29, 2017 12:00 AM
Hello All,
I'm gonna guess that the answer is "no" but here goes anyway... Is there any way that one action can set two variables simultaneously? I have a dropdown box with umpteen choices and each choice sets 2 variables. I don't want to (literally) have 100 or 200 Onselect items if possible.
Thanks for any thoughts
undefined
Discussion (3)
use groups... 1 action triggers an actiongroup with umpteen actions in it... easy to add/delete an action when needed.
Thanks Math. Yes of course... I know... but in this case it makes little difference as I want to reduce both the amount of work and the size of the Lectora "program". To be precise, I need to set exactly 2 variables every time a particular type of action (onselect) is performed. Whether I use two separate actions to do this or one action which runs an actiongroup consisting of two actions does not seem to matter - more or less the same amount of work and same amount of space. It becomes a choice about which is better logically or in terms of appearance/"program" flow - the left hand window of Lectora becomes awfully cluttered even if one reduces things as much as possible.
If I had 3 or 4 variables to set then the actiongroup solution comes into its own. I guess I miss the standard programming "if then" structure and something like "switch/case" statements... I suppose I could hide it all by running an external JS file but I am on a "campaign" of avoiding complications as much as possible in terms of future program/lesson/title maintenance/production, partially explaining my recent messages.
Thanks again Math!
undefined
I can partially agree. Only in the case where for what reason something in the actions need to change. I rather change/add the actions in 1 group, then have to go through umpteen choices to change the onselect actions there.
And indeed using Javascript seems usefull here... creating 1 action with a specific parameter on each onselect would do. As i see it, in this particular case..using Javascript is avoiding complications ;-)
Discussions have been disabled for this post