Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code runs twice

Status
Not open for further replies.

dblarch

Technical User
Mar 8, 2004
29
US
When debugging code for objects on a form I sometimes use ".view" or "msgInfo". These popups appear twice indicating that the code runs two times. As a result results from button presses, etc. take twice as long to appear. It seems a containership issue which I don't know how to resolve.
 
I discovered that the code exists in two places. The same code was placed on the pushbutton (PB) event of a PB on the calling form and in the open event of the called form. The code calls methods in a library. I removed the code on the calling form's PB and the doubled appearance of popups went away.

I'd put the code in two places because the calling form's pushbutton was to change color when code on the called form ran successfully.

If I could return the results , "PASS/FAIL", from the called form to the code on the calling form's PB then when focus is returned, it could respond, e.g. turn Green for "PASS" or red for "FAIL".
 
If I could return the results "

If the code *calling* the form does a

formvar.open(":alias:formname.fsl")
returnVar=formvar.wait(),

and the *called* form does a

formreturn("returnvalue"),

then returnVar gets set to "returnvalue".

Is this what you were asking?

Tony McGuire
 
That's indeed it. The line: returnVar=formvar.wait() : did the trick.

Thanks Tony,
dblarch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top