Compound Statements in DIAL
A compound, or block, statement is a series of statements enclosed in braces ({}). A compound statement performs multiple statements inside a control statement such as if, while, or walk.
Example 1:
The following example evaluates an if expression. If the expression is true, the script processes the compound statement that sends an email and writes a success message to the standard output. If the expression is false, the script writes an error message to the standard output.
if(marker.find_succeeded(Model))
{ mail.multipart(emails.email,"YourReport","yourreport.html","html");
console.writeln("Sent email for Your Report");
}
else
console.writeln("Your Report Marker not found");
Example 2:
The following example:
- Opens the revreport model and walks the directreps dimension
- Saves a copy of the report window as an html file named report.html
-
Sends an email with the attached report to the addresses in the email list
walk(revreport,"directreps")
{ marker.save_report(revreport,"report.html","html");
mail.file(list.email,"Revenue Report","report.html","html");
}