xHarbour Reference Documentation > Statement Reference |
Declares PRIVATE function parameters.
PARAMETERS <params,...>
The PARAMETERS statement declares the formal list of parameters for functions and procedures. The parameters are created as PRIVATE variables when the function or procedure is invoked.
Note: It is recommended to list formal parameters within parentheses in the FUNCTION or PROCEDURE declaration. This results in the formal parameters being created as LOCAL variables. Access to LOCAL variables is faster than to PRIVATE variables.
See also: | FUNCTION, LOCAL, PCount(), PRIVATE, PROCEDURE, PUBLIC, STATIC |
Category: | Declaration , Statements |
// The example demonstrates two possible forms of declaring // parameters. The declaration shown with Sum2() is recommended. PROCEDURE Main ? Sum1( 10, 20 ) ? Sum2( 100, 200 ) RETURN FUNCTION Sum1 PARAMETERS n1, n2 RETURN n1 + n2 FUNCTION Sum2( n1, n2 ) RETURN n1 + n2
http://www.xHarbour.com