Read events is what you should use in your main program, right after the 
call to the menu

do mymenu.mpr
read events

There is no need to use it anywhere else in your app. All forms called 
from the menu or from other forms will use this global read events call.
When you are ready to leave the app, you can use the API call in the 
following program to exit safely:

PROCEDURE ENDAPP
** to ensure all open transactions are closed with no consequences 
(nothing is saved to the tables)

if txnlevel() > 0
    ROLLBACK
endif

**to close all open tables and databases properly

Close Tables all
Close Databases

** to finally exit to Windows

DECLARE ExitProcess IN kernel32 INTEGER uExitCode
ExitProcess(0)

ENDPROC


Rafael Copquin


El 16/08/2012 01:37 p.m., Gary Jeurink escribió:
> I've never used either command before. I remember reading about them. The
> only problem I always struggled with is changing forms that use the same
> database and the data environment would not show up. I would put a menu like
> form in between to select one or the other and then they would function. Is
> the READ EVENTS & CLEAR EVENTS mainly to compile to .exe?
>
> Gary Jeurink
>
> -----Original Message-----
> From: Tracy Pearson [mailto:[email protected]]
> Sent: Thursday, August 16, 2012 8:20 AM
> To: [email protected]
> Subject: RE: just installed vfpro-9
>
> Fred Taylor wrote on 2012-08-15:
>>   Don't think that will work.  The Init code will hang at the READ EVENTS.
>>   
>>   The usual way is to have a .PRG with:
>>   
>>   DO FORM yourform
>>   READ EVENTS
>>
>>   and then have the CLEAR EVENTS in either the Quit button Click, or in the
>>   Form Destroy event.
>>   
>>   Fred
>>
>>   On Wed, Aug 15, 2012 at 4:29 PM, Gary Jeurink <[email protected]>
> wrote:
>>   
>>> So I will put READ EVENTS in the init method and then the CLEAR EVENTS in
>>> the quit form button. Right now I just have a main form that calls any
>>> forms
>>> that I need. I've never had any formal instruction other than books.
>>>
>>> Gary Jeurink
>>>
> Gary,
>
> I agree with Fred.
>
> Read the "Main Files in Applications" topic in the VFP 9 help. Follow it
> with "How to: Control the Event Loop".
>
> You will want an ON ERROR statement to capture and handle errors.
>
> Tracy Pearson
> PowerChurch Software
>
>
>
>
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to