Partager via


LPARAMETERS Command

Assigns data passed from a calling program to local variables or arrays.

LPARAMETERS Parameter1 [AS type [OF ClassLib]] [, Parameter2 [AS type [OF ClassLib]]]

Parameters

  • ParameterList
    Specifies the local variable or array names to which the data is assigned.

    Parameters within ParameterList are separated by commas. There must be at least as many parameters in the LPARAMETERS statement as in the DO ... WITH statement. If more variables or arrays are listed in the LPARAMETERS statement than are passed by DO ... WITH, the remaining variables or arrays are initialized to false (.F.). A maximum of 26 parameters can be passed.

    You can use PARAMETERS( ) to determine the number of parameters passed to the most recently executed program, procedure, or user-defined function.

  • AS type
    Specifies the data type on which this variable is based.

  • OF ClassLib
    Specifies the class library containing the type description on which the type element of this variable is based.

Remarks

Multiple items in ParameterList are separated by commas. LPARAMETERS creates local variables or arrays within a called program, procedure, or user-defined function. Use PARAMETERS to create private variables or arrays.

LPARAMETERS must be the first executable statement in the called program, procedure, or user-defined function if you pass values, variables, or arrays to the program, procedure, or user-defined function.

By default, DO ... WITH passes variables and arrays to procedures by reference. When a value is changed in the called procedure, the new value is passed back to the associated variable or array in the calling program. If you want to pass a variable or array to a procedure by value, enclose the variable or array in parentheses in the DO ... WITH parameter list. Any changes made to the parameter in the called procedure are not passed back to the calling program.

Variables are by default passed by reference to a procedure and by value to a user-defined function. Use SET UDFPARMS TO REFERENCE to pass variables to a user-defined function by reference.

The strong typing required by the CodeSense parser in IntelliSense is available only when you create strongly typed object and variable references by using the optional AS clause.

See Also

DO | FUNCTION | LOCAL | PARAMETERS | PARAMETERS( ) Function | PRIVATE | PROCEDURE | PUBLIC | SET UDFPARMS | PCOUNT( ) Function