CGIUTL.SBR enhancement: new opcode CGIOP_GETPARARY (12) retrieves the entire set of name=value pairs into an ordered map. Syntax:
dimx $req, ordmap(varstr;varstr)
xcall CGIUTL, CGIOP_GETPARARY, status, $req("") {,stdin$}
Note that it does not clear the existing existing map/array, although it will replacing any conflicting elements with key=name.
Status returns the number of pairs loaded.
As with many other CGIUTL operations, the optional stdin$ parameter specifies the contents of the request, which should be in the form of:
name1=value1&name2=value2&...&nameN=valueN
Typically it is retrieved using CGIOP_STDIN (op 1). If not specified, CGIUTL will retrieve the request parameters directly from the web server interface.
For example, if assuming stdin$ = "fromCurrency=US&toCurrency=Euro", the following code...
dimx $req, ordmap(varstr;varstr)
xcall CGIUTL, CGIOP_GETPARARY, status, $req(""), stdin$
print "fromCurrency = "; $req("fromCurrency")
print "toCurrency = "; $req("toCurrency")
will print:
fromCurrency = US
toCurrency = Euro
Or you can use a for-each loop to retrieve all of the name=value pairs without knowing in advance what to expect.