From m204wiki
Revision as of 02:09, 20 February 2020 by Alex (talk | contribs) (Created page with "{{DISPLAYTITLE:$Web_Form_Parm_Binary}} <span class="pageSubtitle">Value of form field to longstring</span> <var>$Web_Form_Parm_Binary</var> retrieves the value of an HTML for...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Value of form field to longstring

$Web_Form_Parm_Binary retrieves the value of an HTML form field as a longstring. Unlike $Web_Form_Parm_Lstr, it returns the value of the form parameter, exactly as sent by the client, rather than translated to ASCII.

$Web_Form_Parm_Binary takes two arguments and returns a longstring or null for any error condition.


%string = $Web_Form_Parm_Binary( name, [occurrence] )

Syntax terms

name The name of the form field, returned by $Web_Form_Name. Required argument if occurrence is not specified, otherwise optional.
occurrence The occurrence number of a form field, or the occurrence number of the form field matching name, if name is specified. This is an optional argument if name is specified; otherwise it is required.

Usage notes

  • The most likely use for $Web_Form_Parm_Binary is to access the value of form fields with contents that are UTF-8 rather than plain ASCII and so are not amenable to simple ASCII to EBCDIC translation. As such, a common uasge for $Web_Form_Parm_Binary is to apply the Utf8ToUnicode function against its result:

    %unicode is unicode ... %unicode = $web_form_parm_binary("XML"):Utf8ToUnicode


If you have an HTML form defined as follows:

<form method="POST" action="myUrl"> <br>Foo:<input type="text" name="foo" size="20"> <br>Bar:<input type="text" name="bar" size="20"> <br><input type="submit"> </form>

The following will retrieve the values of the Foo and Bar fields into unicode strings called %foo and%bar.

%foo = $web_form_parm_lstr('FOO'):utf8ToUnicode %bar = $web_form_parm_lstr('BAR'):utf8ToUnicode

See also