Quartz Composer JavaScript Reference © Cybero Designs  

if ... else

Type Statement
Format
if (condition1)
statement1
else if (condition2)
statement2
else if (condition3)
statement3
...
else
statementN
Commentary
Executes a statement if a specified condition is true. If the condition is false, another statement can be executed. .
Sample code - QC 2 JavaScript
n = (new Date ()). getSeconds ();
if (n <30)
{ (
outputs [0] = "30 is less than";
else (
outputs [0] = "30 is over";
} )
Sample code - QC 3 JavaScript
function ( __string seconds) main ( __number TimeIn[1])
{var result = new Object();
var TimeIn = (new Date()).getSeconds();
if (TimeIn < 30)
{
seconds = TimeIn +" seconds is less than 30 seconds ";
}else{
seconds = TimeIn +" seconds is more than 30 seconds ";
}
result.seconds = seconds;
return result;
}

Return to the Start Page