After successfully building my exe, when I try to run it, I see a blip of it on the screen and then it disappears. Nothing running. What am I doing wrong? Any help is greatly appreciated.
TIA,
FBM
"If you want SQUARE work, you DON'T cut CORNERS!!!" ...
The only reason your program works interactively is because the objects/menues you create still "live" after your program terminates and the command window becomes active, but in the .EXE, there is not command window to become active, so the whole VFP environment quits.
(when running the EXE you really are still "in" VFP; in the VFP-runtime instead of the VFP-IDE)
READ EVENTS is the command that tells the VFP-runtime to enter the "event loop" that waits for input from the mouse and keyboard, and executes menu commands, etc, in response to that input.
In the IDE, the READ EVENTS event loop is not needed because the Command prompt is already an event loop. That is, the VFP-IDE doesn't exit when no program is running.
So, in your main program .PRG, after all the initialization code (which creates the menues, and perhaps displays in introductory window), you should add the command READ EVENTS.
When your .exe is run, VFP will "stop" on that statement and wait for (and respond to) user input. When you want your application to quit, issue the command "CLEAR EVENTS". Execution will resume with the statement after "READ EVENTS"
(alternatively, you can just issue "QUIT" which will exit VFP immediately)
If you don't have a main .PRG file, you could put the READ EVENTS into your main form's "Init" event code, at the end. I don't like this approach.
Thank you for being patient with me .. I'm converting/writing a lot of Clipper apps into VFP and at times fall asleep only to be awakened by the nightmare...LOL
Thanks a lot! I'm sure I'll have more questions as they arise!
FBM
"If you want SQUARE work, you DON'T cut CORNERS!!!" ...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.