Event Driven Programming
in Visual FoxPro
Ted Roche, Senior Consultant

VFP Overview

What to do?
Don’t Panic!
Hitchhiker’s Guide to the Galaxy
Experiment!
FoxPro 1.0, 2.0 had learning curves, too
The quicker you get to the keyboard,
the longer it takes to solve the problem.

Event Driven Programming
in Visual FoxPro
READ EVENTS
CLEAR EVENTS
Questions?

Event Driven Programming
in Visual FoxPro
Okay, there really is a little more to it than that...
Visual FoxPro is so granular!
2nd most popular term after Cool!

Agenda
Basics: What’s an event? - 10 minutes
What Events are there? 20 minutes
Which Controls have which Events? 10 minutes
Event Firing order - 10 minutes
Form’s Inits through Unload
Data Environments
Q & A

What’s an Event?
Events:
System-generated
New Events cannot be added
Methods of the same name fire in response to the event
Event Firing Sequence is one of the keys to understanding VFP

What Events are there?
Let’s look at our event database
Event Frequency Tables

Which controls have which events?
(handouts)
Nearly all have Init, Error, Destroy
Visible controls have Move, Drag, Get/LostFocus
Individual controls have specific events

Event Firing Sequence
Load: First; accept parameters
Init: Innermost outward
allows outermost containers to work on contents
Destroy: Outermost inward
Unload: last; provide return values
Event Modeling Tool

Summary
Events are what it is all about: interactive, visual interfaces
Find the best event to match the sequence of operator action

Where to get more information
#1: FoxHelp.Hlp
Read The Fine Manuals
Read The Fantastic sample code
Related sessions:
Form Designer – Builders
Grids – OOP
VFP Classes