parameter(
NUMBER
)

The parameter( function is used to transfer data between a main procedure and a subroutine.


Parameters

This function has one parameter:

number – is a number specifying what parameter you want to retrieve. All parameters are numbered, starting with 1 (1, 2, 3, 4, etc.).


Description

The parameter( function is used to transfer data between a main procedure and a subroutine. The main procedure can set up one or more data item parameters as part of the call statement (or one of the variations, including farcall, shortcall and execute. The subroutine can retrieve and use these data items using the parameter( function.

Here is a main procedure that calls the subroutine GetNumber with two parameters.

local addCount
addCount=1
call GetNumber,"Add how many records?",addCount
loopwhile addCount>0
    addrecord
    addCount=addCount-1
 endloop

Now let’s look at the GetNumber subroutine, which retrieves these two parameters with the parameter( function.

local temptext
temptext=str(parameter(2))
gettext parameter(1),temptext
setparameter 2,val(temptext)

Error Messages

parameter( function must be used within a procedure. – You’ll see this error message if you try to use the parameter( function anywhere but in a procedure (for example in a form object).

parameter( function: Current procedure was not called as a subroutine. – This means that you are trying to use the parameter( function in your main procedure. It should only be used in a subroutine.

Parameter does not exist – The requested parameter was not supplied by the calling procedure.


See Also


History

VersionStatusNotes
10.0No ChangeCarried over from Panorama 6.0