Statement
|
Comments.
|
x = 0;
|
Enter using Add Script | Statements | name = expr;
Use the down arrow next to Property: to select Variable:. This will cause the value to be treated as a variable. 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 use copy and paste to copy 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;
|
Enter 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
|