General information
Category:
Coding, syntax & commands
Jeff,
I commiserate. Although I have been playing with VFP 5 for a few months
now, I have only fully moved to it from FP 2.6 DOS in the last four weeks
and, from my experiences, I am certain that the CLEAR EVENTS issue is
one that most people get wrong initially through not appreciating :
a) That the object code where the CLEAR EVENTS was issued continues
to be processed.
b) That on completion of that object code what happens next is that
processing continues after the last READ EVENTS.
I believe this is not very well explained ANYWHERE, whether in Microsoft
documentation or in Third Party books. For instance, I came across
the scenario where a particular method called another method, of
ANOTHER object, where that second method issued the CLEAR EVENTS.
Just like you, I initially got it wrong because I thought processing
would go straight back to the next line of code after the READ EVENTS,
taking the doc literally, effectively. Once I realised that was not
really happening quite that way, I then got it wrong again because
I thought that not only the method code would complete, but that the
calling method's code would also complete, which it doesn't.
I think a lot of people go through the same learning curve, unnecessarily
in my opinion : READ EVENTS .... CLEAR EVENTS is such a crucial issue
to understand it should be explained better in Microsoft doc and Third
Party Books, with good supporting examples.
Michel.
================== Original message follows =====================
>Just discovered that issuing a CLEAR EVENTS in an event/method does not immediately return program execution to the line following READ EVENTS, but instead finishes executing the event/method before doing so.
>
>Therefore, if CLEAR EVENTS is not the last line of code in an event/method, it must be followed by a RETURN TO or the event/method will continue processing before program execution returns to the line following READ EVENTS.
>
>Don't know if this is a bug or feature - it is certainly undocumented. Actually, it could be useful with respect to insuring the execution of clean-up code.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only