MvCOMMENT#
Used to annotate your program and inserts comments or code ignored by the compiler. They are also useful when you are developing and debugging your program.
Syntax
<MvCOMMENT>
</MvCOMMENT>
Miva Script comments inside your script explain code for readability. Comments always end with a closing tag, can span single or multiple lines, and are ignored by the compiler.
Isolating Problematic Code#
Wrap a block of code in comments to isolate it during debugging:
<MvFUNCTION NAME="Divide" PARAMETERS="var1,var2" STANDARDOUTPUTLEVEL="">
<MvCOMMENT>
There is a problem in here somewhere
<MvFUNCTIONRETURN VALUE="{ l.var1 / 0 }">
</MvCOMMENT>
</MvFUNCTION>
HTML Comments#
You can also use ordinary HTML comments (<!-- ... -->
), which are passed to the browser but not displayed. MivaScript inside HTML comments is still processed, allowing embedded test scripts to appear in the source without showing on the page:
<!-- Order_Date = <MvEVAL EXPR="{ g.order_date }"> -->
Examples#
Single-Line Comment
<MvCOMMENT>The code below will output the year.</MvCOMMENT>
<MvEVAL EXPR="{ s.tm_year }">
Multi-Line Comment in a Function
<MvFUNCTION NAME="Sum" PARAMETERS="var1,var2" STANDARDOUTPUTLEVEL="">
<MvCOMMENT>
This function adds two numbers
Rounded to the nearest whole number
</MvCOMMENT>
<MvFUNCTIONRETURN VALUE="{ (l.var1 + l.var2) ROUND 0 }">
</MvFUNCTION>