Partilhar via


User-Defined Functions

User-defined functions make it possible for you to extend the Visual FoxPro language. You can create specialized functions to use in one or more of your applications. User-defined functions (UDFs) include stand-alone programs saved in files with .prg extensions, as well as procedures and functions contained inside a program.

To create a function or a procedure, use the FUNCTION or PROCEDURE commands to assign a name to the function or procedure. Follow the first line with any number of statements. Use a PARAMETERS or LPARAMETERS statement as the first executable line of a stand-alone UDF that receives parameters. End a UDF that returns values to the calling program with a RETURN statement. You can call UDFs as procedures or as functions. You can pass up to 24 parameters to a UDF.

See Also

Calling a Function | Calling a Procedure | FUNCTION Command | PARAMETERS Command | Parameter Passing by Value or by Reference | PROCEDURE Command | RETURN Command | Data Manipulation