Hey guys,
I'm trying to store triggers in an array but run into an error every time I try to save.
I can set null local triggers to the trigger array, but anytime I try to use another trigger it won't work.
ex: TrigArray[1] = Initiation;
I don't see why it errors, all help appreciated on this one!
Or do you mean Gui triggers? Gui-created variables get a prefix, so If you want to access the Gui trigger Initiation, you would need to call it by gt_Initiation
Well, for some reason whenever I try to set a trigger variable to another trigger, it errors.
So from your code I'm guessing I need to use TriggerCreate("trigger") even if the "trigger" is already written?
Edit: Since I'm going to run into this problem too, once I set these triggers under these variables how do I call them with parameters?
Yes, you need to create the trigger with TriggerCreate before you can execute it. But if you have created it elsewhere, and saved it to a variable, you can of course use that. Not sure what you mean with the trigger already being written.
The only parameter you can send directly is a boolean (testConds). Beyond that, you have to use global variables or the data table to send parameters to the trigger. Execute it with TriggerExecute(<trigger>, <testConds>, <wait until done>).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys, I'm trying to store triggers in an array but run into an error every time I try to save. I can set null local triggers to the trigger array, but anytime I try to use another trigger it won't work. ex: TrigArray[1] = Initiation; I don't see why it errors, all help appreciated on this one!
Not sure I understood the problem. I can use arrays of triggers just fine:
Or do you mean Gui triggers? Gui-created variables get a prefix, so If you want to access the Gui trigger Initiation, you would need to call it by gt_Initiation
Well, for some reason whenever I try to set a trigger variable to another trigger, it errors. So from your code I'm guessing I need to use TriggerCreate("trigger") even if the "trigger" is already written?
Edit: Since I'm going to run into this problem too, once I set these triggers under these variables how do I call them with parameters?
Yes, you need to create the trigger with TriggerCreate before you can execute it. But if you have created it elsewhere, and saved it to a variable, you can of course use that. Not sure what you mean with the trigger already being written.
The only parameter you can send directly is a boolean (testConds). Beyond that, you have to use global variables or the data table to send parameters to the trigger. Execute it with TriggerExecute(<trigger>, <testConds>, <wait until done>).