Statement
|
Comments.
|
x = 0;
|
Enter using Add Script | Statements | name = expr;
Type "x" into the Name field (this field defines a property or variable). Then add the value "0" (zero - with no quotes) into the value field below the Operator. In this case the Target: option can be left blank. This option is used to define the name of the Object that contains the property or variable. Leaving this value blank is the same as entering the value this
|
y = 0;
|
Enter using Add Script | Statements | name = expr;
Another way to enter this statement is to copy and paste the x=0 statement, then change to parameters to make this statement y = 0;
|
while (x <= 10) {
|
Enter using Add Script | Conditional | while (...) {
Enter x <= 10 into the lower dialog box
|
y = x * x;
|
Enter using Add Script | Statements | name = expr; or copy and modify previous statement
|
trace("y = " add y add " x = " add x);
|
Enter using Add Script | Debugging | trace(...)
Note that the add command is used to join multiple strings
|
if (y > 50) {
|
Enter using Add Script | Conditional | if (...) {
|
trace("wow that is big");
|
Enter using Add Script | Debugging | trace(...)
This command is only executed if the value of y is greater than 50
|
}
|
Entered as part of the if statement. Shows the end of the if statement
|
x = x + 1;
|
Click on the ending bracket for the IF statement, and enter this script using Add Script | Statements | name = expr;
If this statement is missing, x will never increase and loop will continue indefinitely.
Note that x++ or x += 1 statements could have also been used
|
}
|
Entered as part of the while statement. Shows the end of the while loop
|