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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I gotta be an Idiot

Status
Not open for further replies.

metron9

Programmer
Mar 5, 2002
94
US
Its 3am and I am still pulling my hair out because my forms run great in foxpro but not in an EXE. So I made a simple program that finally seems to work if i am doing something wrong let me know, I have one question as to where the clear events should go, QueryUnload or Unload

Program file hello.prg

do form c:\helloworld\forms\form1
read events

Form file form1.scx
C reated with NEW NEW FORM
All properties DEFAULT except for
SHOWWINDOW = 2 as top level form

Code placed in form1.unload procedure
thisform.release
clear events
quit

I made another form
MODAL
SHOWWINDOW = 1 in top level form
NAME oForm2

Next I put the code in button.click procedure
do form c:\helloworld\forms\form2 NAME oForm2 LINKED

And in the form2.UNLOAD procedure
thisform.release

now I am going to bed and its 3:50 AM, oops have to drive home first but I would not have slept If I didnt figure it out.
 
metron9

* Program file hello.prg
do form c:\helloworld\forms\form1
read events
quit

THISFORM.Release() should be called from anywhere in form1 to release the form, but the code should not be included in the .UnLoad() event

* Code placed in form1.unload procedure
clear events
HTH

Chris [pc2]
 
metron9

You may want to reconsider your titles of your posts. "I gotta an idiot" doesn't really give us a clue as to what your problem is. Please refer to faq183-874
Mike Gagnon
 
If you do a program that does not start with a form. the order of things change. I have made it, after login, to display a menu only, with no forms open. the user makes a selection , then the form needed is open. so, I do not put clear eventsinthe form at all. CLEAR EVENTS is in the menu bar for Exit.

main.prg

do mymenu.mpr
read events Attitude is Everything
 
metron9,

to what mgagnon said - please also read
thread184-248426

regards from Germany

Klaus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top