[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|           PARAMETERS            |
+---------------------------------+
PARAMETERS <parameter list>

-----------------------------------
Defines memory variables as <parameter list>.
-----------------------------------

The PARAMETERS command allows local memory variable or array names to be
assigned to data passed from a calling program, procedure or
user-defined function (UDF).  This command must be the first statement
in the called program.

By default, parameters are passed to programs and procedures by
reference and to functions by value.  You can pass parameters to
programs and procedures by value by enclosing them in parentheses.  See
SET UDFPARMS for more information on passing parameters to functions by
reference.

Entire arrays may be passed by reference to a procedure or UDF.  If
UDFPARMS is SET TO REFERENCE, the entire array is passed.  If UDFPARMS
is SET TO VALUE, only the first element of the array is passed.

A PARAMETER within the <parm list> may be any valid memory variable or
array name.  If the value of a memory variable or array element is
changed in the called program, the new value may be passed back to the
calling program.

Parameters within the <parm list> are separated by commas.  If more
variables or arrays are listed in the PARAMETERS statement of a program
or procedure than are passed by the calling program or procedure, the
remaining variables or arrays are initialized to false (.F.).

The PARAMETERS() function will return the number of parameters that were
passed to the last routine.

+---------------------------------+
|         Program Example         |
+---------------------------------+
ON ERROR DO errhand WITH ERROR(), MESSAGE(), ;
        MESSAGE(1),PROGRAM(),LINENO()

USE nodatabase

PROCEDURE errhand
PARAMETER merror, mess, mess1, mprog, mlineno
? 'Error number: ' + LTRIM(STR(merror))
? 'Error message: ' + mess
? 'Line of code with error: ' + mess1
? 'Line number of error: '+ LTRIM(STR(mlineno))
? 'Program with error: ' + mprog

-----------------------------------

See Also:  DO, FUNCTION, PARAMETERS(), PROCEDURE, PRIVATE, PUBLIC, SET
UDFPARMS

-----------------------------------

See Also: DO FUNCTION PARAMETERS() PROCEDURE PRIVATE PUBLIC SET
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson