lgodfrey Posted July 1, 2007 Share Posted July 1, 2007 I do not know how to test this to get the answers, so I thought I'd ask so I make sure I know exactly how code execution is controlled using GUIs. I am running GUI in event mode. 1) when an event interrupts the main code, is this interruption done at the term level or the line level? eg the main routine is executing the line IF a>b or c>d then dosomething() I can see four possible interuption points in this example: The term a>b is being evaluating when there is a GUI event notification reaching the main routing. Is this term calculation interrupted, or is the term calculation finished and the the line interrupted before the c<d term, or is the full logic statement calculated and then the line interupted at the branch point "then", or is the entire line finished and then the code is interrupted before the branch to the function dosomething? 2) When the function assigned to the button is being executed, is code execution control maintained by the code flow of the assigned function, even if the assigned function calls other functions? Maybe put another way: regardless of function calls withing the assigned function, the main code is interrupted until the assigned function sees an endfunc or a return? 3) Can the assigned function for a GUI button recursively call another function that is in the middle of executing code since it was called by the main code? IE Function1 has been called by the main routing and is executing line 10 when an event interrupt triggers Funciton2 Func Function1() 1... 2.. . . 10 main routine is executing this code line when event triggers Function2 . . Return $answer EndFunc Func Function2() 1 2 3 $X=Function1() . . EndFunc Does the current execution of Function1 halt, and then all the code of Function2 executed, including Function1, and then control is returned to the main code and picks up at line 10 of Function1? I'm, Lovin' IT, X Link to comment Share on other sites More sharing options...
lgodfrey Posted July 1, 2007 Author Share Posted July 1, 2007 Followup: I've tried to run some tests again to look at these questions, and the only thing I have found so far is that: If a dialog window is open in the main coding, it appears that execution control will not be given to the function associated with the GUI event until that dialog window is closed. Of the questions I asked, the one about recursive calls to functions is the most important to me.[' Best Regards Larry I'm, Lovin' IT, X Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now