| 05-29-2006, 04:37 AM | #1 |
If you run a second trigger from within a trigger will waits in the second trigger pause the first trigger? |
| 05-29-2006, 04:57 AM | #2 |
If you use the TriggerExecute(GUI trigger run) or ExecuteFunc functions, no. If you use the call statement, yes. |
| 05-29-2006, 01:29 PM | #3 | |
Quote:
I'm pretty sure it's otherwise. Let me show this example: Trigger: It will then show "2" when you start up the game. Conclusion: If you run a GUI trigger (b) from another GUI trigger (a), the first one (a) will pause untill the second one (b) is done. - Soultaker |
| 05-29-2006, 02:24 PM | #4 |
Yes, you are correct Soultaker, as Jass uses the same method as Java and most other laungages with reacursion. Just in a different manner |
| 05-29-2006, 02:31 PM | #5 |
putting a wait before the Test_Integer = 2 will return 1 instead |
| 05-29-2006, 02:50 PM | #6 |
Yea, the wait will return a null to the reacursion, thus not returning a command to begin where it left off on the first trigger |
| 05-29-2006, 03:07 PM | #7 | |
Quote:
That is true, unless trigger B uses waits, in which case trigger A will carry on running. |
| 05-29-2006, 08:57 PM | #8 |
Well duh; Run trigger interrupts the current thread, but they really are distinct threads that won't block each other when waiting. This isn't recursion in the usual vertical sense, it's horizontal, if that makes any sense. To sum: If you use TriggerExecute, waits in the executed trigger will not block the first trigger. However, it does interrupt and begin executing immediately. |
| 05-29-2006, 09:13 PM | #9 |
Its not really recursion, but i see it in a sense of that, it runs the requested thread then waits for it to get to the end then return back. Yes it nearly has nothing to do with recursion, with the turn left or right with binary, but i just see it in a sense of recursion |
