Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I need to define and raise a custom event
Message
From
04/05/2001 11:30:41
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
 
 
To
03/05/2001 21:01:10
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00503314
Message ID:
00503547
Views:
19
>I was wondering... Is there any way to define and raise a custom event in VFP ?
>If you found the answer, please let me know. I need it desperately !

What's the "trigger" for this event ?

Normally, you can't create "custom events" in VFP. However, in some situations, I have generated some obscure key code (ie. something > CHR(200)) and then responded to it in .Keypress(); it then "seemed" like a custom event.

There's also the old READ EVENTS "loop".

If your mainline is build around a ...
DO WHILE lQuit = .F.
   READ EVENTS
ENDDO
... then you can have a "case" within the DO loop that tests a "message queue" for any pending events prior to doing the READ EVENTS. Any time you need to handle a particular event, you stuff the info into the "message queue" and do a CLEAR EVENTS. The "case" handles the events until the queue is "empty"; eg.
DO WHILE lQuit = .F.
   DO CASE
   CASE cEvent = "Report"
      ...
   CASE cEvent = "New Form"
      ...
   OTHERWISE
      READ EVENTS
   ENDCASE
ENDDO
It's "sort of" the way Windows does "messaging" internally.
Previous
Reply
Map
View

Click here to load this message in the networking platform