xHarbour Reference Documentation > Statement Reference xHarbour Developers Network  

PARAMETERS

Declares PRIVATE function parameters.

Syntax

PARAMETERS <params,...>

Arguments

<params,...>
This is a comma separated list of symbolic names for the parameters to declare.

Description

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.

Info

See also:FUNCTION, LOCAL, PCount(), PRIVATE, PROCEDURE, PUBLIC, STATIC
Category: Declaration , Statements

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe