3.7 Passing Parameters to a LANSA Function

You can pass parameters to a LANSA function that is executed directly.

If you want to pass parameters to a LANSA function, you would extend the URL of calling a LANSA function directly to include:

+FUNCPARMS+param1+...+param5

The keyword, FUNCPARMS (can be in lower-case), is used to indicate that the rest of the URL are the parameters to the function. Each parameter must follow the syntax:

<field_name>(tllld):value

where

<field_name>

is the name of the field to receive the parameter

T

is the field type (A for alphanumeric, P for packed and S for signed, L for lowercase alpha fields)

Lll

is the length of the field value with leading zeros

D

is the number of decimal positions

Value

is the value of the parameter.

For example, if you wanted to pass a value of ‘A0001’ to the EMPNO field, the syntax of the parameter would be:

EMPNO(A0050):A0001

Your final URL might appear as follows:

http://www.lansa.com/cgi-bin/lansaweb?PROCFUN+MYPROC+MYFUNC+DEM+FUNCPARMS+EMPNO(A0050):A0001

 

Note that the length of the field includes leading zeros and the delimiting character used is the colon (:) character.

If the value of the parameter includes embedded blanks, you must surround the value with double quote (“) characters.

You are allowed to specify up to 20 function parameters in a URL.

For a method of passing parameters, you may also wish to refer to HTTP Header Variables in the Web Administration Guide.