Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to start 2

Status
Not open for further replies.

nguntay

Programmer
Oct 5, 2004
20
TR
I am an old programmer of foxpro 2.5 for dos.
Recently purchased vfp9.
since one week, triying to figure out how to use read events command.
Badly need help to write a program that simply adds to numbers (on two textboxes) on a form tru a command button , so that I can figure out the use of "read events" command with in a form.

thanks to Microsoft, they made it so simple to start with that tasmanian project so that every one can learn within a century without help (!).
 
nguntay,

To start it all from scratch:
Take a look at the solution application, which is included with source code. There you have a nice and working startup code:

Take a look at the app itself:
Code:
CD HOME(2)
DO solution\solution.app

Then take a look at the source code:
Code:
CD HOME(2)
MODIFY PROJECT solution\solution.pjx

Take a look at the main.prg in the code section of the project. This should get you started.

Bye, Olaf.
 
Olaf

Thankyou very much for your advice for where to look.

Rob

Thankyou very much for your valuable help offer.

Mike,

thats something new to me. So I have to learn and then check for it. Thanks for your advice .

Regards
 
******** SETTINGS *******
******** DECLARATIONS *******
******** DECLARATIONS *******
******** PROGRAM BODY *******
CLEAR
DO FORM c:\deneme\forms\try1.scx
READ EVENTS
CLOSE ALL
RELEASE ALL

CLEAR EVENTS

QUIT

Your form, not the PRG, need to issue the CLEAR EVENTS command otherwise the control will never return to your PRG.
It is exactly like
Function XYZ
I = 1
J = 2
Return (I + J)
Wait window “Hello” && This line will never executed
To demonstrate this point to yourself, put a wait window after your READ EVENTS.
Run your program as it is and wait for the wait window to appear, it will not that is why you can’t close your application.

Regarding the EXE issue, you application should work fine as it is (I actually duplicated it). It seems like you changed some properties on you form. To figure out what you changed
Right Click your form in the design mode and select Properties
Right Click the Drop Down List Box on the Top of the Properties Window
Click Non-Default Properties Only

This will give you a view of all the properties you changed. If you think you need to restore the default for any property, right click it and select Set To Default.



Walid Magd
 
nguntay,

To follow up Walid's advice, the last line in your main program should be READ EVENTS.

Your lines...
Code:
CLOSE ALL
RELEASE ALL
CLEAR EVENTS
QUIT
...should all be in the Destroy or Unload event method of form try1. I actually have it in both methods - don't know why!


Hope that helps,

Stewart
PS If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top