MvCAPTURE#
Sometimes we deal with functions that output directly to the screen. By capturing the output in a variable, it is possible to pass the results to another function or save the output to a file.
Syntax
<MvCAPTURE VARIABLE = "{ expression } | variable name"
STANDARDOUTPUTLEVEL = "html, text, compresswhitespace">
</MvCAPTURE>
Attributes#
Attribute | Description |
---|---|
VARIABLE |
(Required) Variable name or expression that results in a variable name where the captured output is stored. |
STANDARDOUTPUTLEVEL |
(Optional) Specifies what gets returned in VARIABLE . If omitted, output is returned un-altered.• html : Default. HTML is output to the browser.• text : Default. Text (non-HTML) is output to the browser.• compresswhitespace : Eliminates extra whitespace (spaces, tabs, new lines) from MivaScript output. |
Syntax#
<MvCAPTURE VARIABLE="l.output_variable">
text, expressions, etc.
</MvCAPTURE>
Examples#
Generic Capture
<MvCAPTURE VARIABLE="l.output_variable">
text, expressions, etc.
</MvCAPTURE>
In this example we capture the HTML output of a function that creates a dropdown list of states.
Capturing a Function's Output
<MvCAPTURE VARIABLE="l.state_selbox">
<MvCOMMENT> Outputs a select box to the browser. </MvCOMMENT>
<MvEVAL EXPR="{ State_Select(g.ShipTo_State) }">
</MvCAPTURE>