Can someone please tell me the difference between user defined procedures and user defined functions in FoxPro 2.6. When should I use one or the other ?
The help file uses the same example, so I can't differentiate between the two.
Major differences:
function return one value, assigned by RETURN.
It may be write directly in expressions.
Procedure must be called "do" and,
although as function may too alter variables,
have no value.
Paul,
Try this answer.
You never need to use the FUNCTION statement.
The PROCEDURE statement will do the what a FUNCTION statement does.
optional - [memvar list seperated with commas]
you do not have to pass memory variables to a FUNCTION or a PROCEDURE,
However
If in you program you define a routine as a FUNCTION,
Then you MUST call it as a FUNCTION like this:
=FUNCTION([memvar list seperated with commas])
or
memvar=FUNCTION([memvar list seperated with commas])
or
if FUNCTION() > value
If in you program you define a routine as a PRODECURE, then you can call it as a PROCEDURE or as a FUNCTION like this
do PROCEDURE [with memvar list seperated with commas]
or
=PROCEDURE([memvar list seperated with commas])
or
Memvar=PROCEDURE([memvar list seperated with commas])
or
if PROCEDURE([memvar list seperated with commas]) > value David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
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.