main.prg problem 
Author Message
 main.prg problem

Hi everyone,

What is wrong with this code. Within the project manager, when I run the
main.prg I have no problem. After I exit the form, I must cancel the
program in order to modify or rerun it. When I run the form itself from
the project manger I do not have this problem.

DO form topform
READ events
ON SHUTDOWN Do cancel

ON ERROR
Release ALL EXTENDED
Clear ALL
RETURN
EXIT

*my cancel program..this file is separate from the main.prg

 ON SHUTDOWN
 thisform.release
 Clear EVENTS
 Clear RESOURCES
 Close ALL
 Clear
 Wait CLEAR
 cancel

Any ideas?

Thanks,
Kerry

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 25 Jan 2003 03:00:00 GMT  
 main.prg problem

Kerry,

Put ON SHUTDOWN before the read events

Hugo


Quote:
> Hi everyone,

> What is wrong with this code. Within the project manager, when I run the
> main.prg I have no problem. After I exit the form, I must cancel the
> program in order to modify or rerun it. When I run the form itself from
> the project manger I do not have this problem.

> DO form topform
> READ events
> ON SHUTDOWN Do cancel

> ON ERROR
> Release ALL EXTENDED
> Clear ALL
> RETURN
> EXIT

> *my cancel program..this file is separate from the main.prg

>  ON SHUTDOWN
>  thisform.release
>  Clear EVENTS
>  Clear RESOURCES
>  Close ALL
>  Clear
>  Wait CLEAR
>  cancel

> Any ideas?

> Thanks,
> Kerry

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 25 Jan 2003 03:00:00 GMT  
 main.prg problem
Hi Kerry,

'ON SHUTDOWN Do Cancel' should be placed before 'READ EVENTS'.

Hope this helps

Johnny


Quote:
> Hi everyone,

> What is wrong with this code. Within the project manager, when I run the
> main.prg I have no problem. After I exit the form, I must cancel the
> program in order to modify or rerun it. When I run the form itself from
> the project manger I do not have this problem.

> DO form topform
> READ events
> ON SHUTDOWN Do cancel

> ON ERROR
> Release ALL EXTENDED
> Clear ALL
> RETURN
> EXIT

> *my cancel program..this file is separate from the main.prg

>  ON SHUTDOWN
>  thisform.release
>  Clear EVENTS
>  Clear RESOURCES
>  Close ALL
>  Clear
>  Wait CLEAR
>  cancel

> Any ideas?

> Thanks,
> Kerry

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 25 Jan 2003 03:00:00 GMT  
 main.prg problem
On shutdown fires when you exit vfp, not when you exit the form. In your
app, if you just close a form, the read events is still in effect, not to
mention the fact that the on shutdown line isn't executed until the events
are cleared. That's why you've got to cancel. The on shutdown, which tells
vfp what to do *if* and *when* it's shut down goes in your setup code, it
doesn't actually shut anything down by itself.
- Lew S

Quote:
> Hi everyone,

> What is wrong with this code. Within the project manager, when I run the
> main.prg I have no problem. After I exit the form, I must cancel the
> program in order to modify or rerun it. When I run the form itself from
> the project manger I do not have this problem.

> DO form topform
> READ events
> ON SHUTDOWN Do cancel

> ON ERROR
> Release ALL EXTENDED
> Clear ALL
> RETURN
> EXIT

> *my cancel program..this file is separate from the main.prg

>  ON SHUTDOWN
>  thisform.release
>  Clear EVENTS
>  Clear RESOURCES
>  Close ALL
>  Clear
>  Wait CLEAR
>  cancel

> Any ideas?

> Thanks,
> Kerry

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sat, 25 Jan 2003 03:00:00 GMT  
 main.prg problem
Kerry,
Also, make sure you have a CLEAR EVENTS in the Unload and QueryUnload
events of your form.

- Keith



Quote:
> Hi everyone,

> What is wrong with this code. Within the project manager, when I run
the
> main.prg I have no problem. After I exit the form, I must cancel the
> program in order to modify or rerun it. When I run the form itself
from
> the project manger I do not have this problem.

> DO form topform
> READ events
> ON SHUTDOWN Do cancel

> ON ERROR
> Release ALL EXTENDED
> Clear ALL
> RETURN
> EXIT

> *my cancel program..this file is separate from the main.prg

>  ON SHUTDOWN
>  thisform.release
>  Clear EVENTS
>  Clear RESOURCES
>  Close ALL
>  Clear
>  Wait CLEAR
>  cancel

> Any ideas?

> Thanks,
> Kerry

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 26 Jan 2003 03:00:00 GMT  
 main.prg problem
Thanks for the help from everyone. Your experience is my benefit.
Hopefully, I can contribute to this NG before long.

Thanks again
Kerry

Sent via Deja.com http://www.deja.com/
Before you buy.



Sun, 26 Jan 2003 03:00:00 GMT  
 main.prg problem
If his app has more than one form and/or runs out of a menu, he may not want
to do this.
- Lew S


Sun, 26 Jan 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Referencing a form control from the main.prg

2. #DEFINE varname only shows up in MAIN.PRG

3. Explain setpath() in tastrade main.prg

4. Executing a PRG from a PRG

5. Big PRG or Small PRG?

6. making forms to be main screen instead of reside in vfp main window

7. VFP Problem: traslate VCX class to PRG

8. Screen problem in .Prg file

9. Problem with Gendbc.prg

10. **Prg need VFP.exe problem **

11. Intermitten problem: a1.prg not found

12. Help! prg/form problem in VFP 5.0a

 

 
Powered by phpBB® Forum Software