Greetings all,
I'm trying to do some "tricky stuff" with an ON KEY statement in the init event of a form. I'd like multiple commands to execute, but can't figure out a way to trick VFP into doing my bidding!
If I use:
ON KEY ESC DO THISFORM.bailout()
and put the commands in a method (named bailout) off the form, then I get the error "THISFORM can only be used within a method." because I'm actually in the "read events handler".
I don't want to have a separate .prg with my procedure in it (because then this nifty little form won't be as portable!), so I tried declaring the bailout() procedure in the init and/or load events of the form - but it won't let me do that either.
So the last straw I'm grasping at is: Can I fake VFP into executing multiple commands as though it were a single command? Kind of like in C++ where you can use the "curly brackets" { and }. Then I could use a line like:
ON KEY ESC {wait window "1"; wait window "2"}
But that doesn't work either!
Any/all ideas appreciated - TIA!
Kevin E. Stroud
kestrou@nexlan.com