|
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.
Miva Script comments inside your script to explain the code can be used to make it more readable. Comments are always ended with a closing tag and can span a single or multiple lines. Example:<MvCOMMENT>The code below will output the year.</MvCOMMENT> <MvEVAL EXPR"{ s.tm_year }"> <MvFUNCTION NAME="Sum" PARAMETERS="var1,var2" STANDARDOUTPUTLEVEL=""> <MvCOMMENT> This function adds two numbers Rounded to the neares whole number </MvCOMMENT> <MvFUNCTIONRETURN VALUE="{ (l.var1 + l.var2) ROUND 0 }"> </MvFUNCTION> The contents of a comment are ignored by the compiler and not passed on to the browser, so a they are also used when, debugging, and testing your program. By surround a block of code with comments, you may be able to isolate and locate the section with a problems. Example:<MvFUNCTION NAME="Divide" PARAMETERS="var1,var2" STANDARDOUTPUTLEVEL=""> <MvCOMMENT> There is a problem in here somewhere <MvFUNCTIONRETURN VALUE="{ l.var1 / 0 }"> </MvCOMMENT> </MvFUNCTION> You can also use ordinary HTML comments. These are passed to the browser but not displayed. MivaScript within HTML comments are still processed allowing you to embed test script that shows up in the source but not on the display. Example:<!-- Order_Date = <MvEVAL EXPR"{ g.order_date }"> --> |