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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Functions and VFP

Status
Not open for further replies.

Qwark

Programmer
Sep 26, 2000
59
NL
Hello everybody,

First of all I am an beginning VFP programmer.
Does any one know how to use a function in a .prg file in a form.

For example
frmmain has a button ok. In de click event I want to use a function (percentage) wich is placed in de program.prg file.
this doesn't work
i = percentage(5) IN program.prg
Or
i = percentage(5)

It's a simple problem but i can't find anything in my books.
Can anyone help me please........ [sig][/sig]
 
Assuming you have several forms and several programs. You will likely need to setup a procedures file. Fortunately this is easy in VFP. Add the following command line into your main PRG.

SET PROCEDURE TO prgName

You can have multiple procedure files with the ADDITIVE option

SET PROCEDURE TO prgName2 ADDITIVE

Now both prgName and prgName2 are procedure files and can be accessed by all forms and programs in your project.

[sig]<p> Pete<br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>What your mother told you is true! You will go blind! (from moonshine anyway)[/sig]
 
Thanks, It works. It was very very simple, but you must know it before you can use it. [sig][/sig]
 
I too often make things much harder than they actually are. Experience is a mother. [sig]<p> Pete<br><a href=mailto:blindpete@mail.com>blindpete@mail.com</a><br><a href= > </a><br>What your mother told you is true! You will go blind! (from moonshine anyway)[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top