Retrieve single parameter

xcall CGIUTL, CGIOP_GETPAR, parmname, parmval, status {, string}

Opcode 2, CGIOP_GETPAR, retrieves the web form parameter by name. Typically this requires that the form was submitted with the "POST" action, and that the A-Shell session was launched via the CGI process using either the -cgi or -fcgi switch, in which case the parameters are actually passed via the stdin channel. Alternatively, the application can provide a source string to replace stdin.

Parameters

parmname  (String)  [in]

name of the parameter to retrieve

parmval  (String)  [out]

value of the retrieved parameter

status (Signed Num)  [out]

0 for OK, -1 if the parameter is not found, –2 if not in CGI mode.

string  (String)  [in]

If string is specified it is used in place of stdin. It must be formatted in the same way that stdin would have been formatted by the CGI interface, i.e.:

name1=value1&name2=value2&...nameN=valueN"

Comments

"+" characters are interpreted as spaces, and anything of the form %xx (where xx are two hex digits) is translated to the equivalent ASCII character.)

Note that if you use the form action GET instead of POST, you can query the variables by retrieving the definition of the environment variable QUERY_STRING (see MX_GETENV) into the string parameter.

Also note that when string is specified, you do not actually have to be in CGI mode, and thus the operation could be useful for non-CGI purposes.