>>>Hi,
>>>
>>>Please explain to me what I don't understand. A form is being open. The INIT should fire first. Then user clicks on a button cmd.Go_Next and the code in method thisform.go_next is executed. This code comes across an error.
>>>I analyze the stack. But the method INIT is not in the aProgStack. This is the sample code how I scan through the stack:
>>>
>>>ASTACKINFO(aProgStack)
>>>FOR iEle = 1 TO ALEN( aProgStack, 1 )
>>>
>>>NEXT
>>>
>>
>>Nothing missing. The form.load, each control's .init() was done, form.init()... it has all done up to form.show(), after which the execution returns to the Read Events statement.
>>Then the click can happen.
>
>First, thank you for your prompt reply. Ok, I understand what you are saying.
>How come the aProgStack has a call to my APPLICATION_SETUP.START method? Is it because this method has the READ EVENTS that it is not cleared from the stack?
That's where all code returns whenever it finishes processing user input, that's where the event loop starts.
>Would your explanation tells me that since the GO_NEXT code comes across an error, there was no error in LOAD and INIT methods?
Well... no errors that would stop execution, or else your form wouldn't show up, right? It depends on what you consider an error...
>UPDATE. Here is what I am trying to find. When a user clicks on the GO_NEXT button, the code comes across a problem where the main cursor of the form is lost. That is, the SELECT("Main_Cursor") is 0. And I am trying to find where in this form (which is quite complicated) the cursor is being closed.
...because, obviously, if closing the cursor is not an error then it's the cause of it further down the road.
If you can use a debugger, set a watch expression on SELECT("Main_Cursor") and put a Set Step On in form's .load(), then it should stop twice: once the cursor is created (it would show a non-zero value) and next when it's closed (becomes zero).