public void main ( ) {
Number limit = 0 ; Object[] objects = ; |
| |
// Copyright 2007, R.G.Baldwin |
| doInOrder { |
| |
// Illustrates saving and then accessing mixed |
| // objects from an array of type Object. |
| } |
| doInOrder { |
| |
// Get input from user and pause for one second. |
| limit .set( value , ( NumberDialog( question = Enter an integer between 1 and 5 inclusive. ) ) ); |
| // Clamp limit at maximum of 5. |
| if ( ( limit > 5 ) ) { |
| |
limit .set( value , 5 ); |
| } else { |
| |
Do Nothing |
| } |
| wait( 1 second ); |
| } |
| doInOrder { |
| |
// Add objects to the array. |
| objects [ 0 ] = penguin ; duration = 0 seconds |
| objects [ 1 ] = cow ; duration = 0 seconds |
| objects [ 2 ] = hare ; duration = 0 seconds |
| objects [ 3 ] = monkey ; duration = 0 seconds |
| objects [ 4 ] = tortoise ; duration = 0 seconds |
| } |
| for (int index = 0 ; index< limit times ; index += 1 ){ |
| |
// Set opacity property on objects in array. |
| ( objects [ index ] ) .set( opacity , 1 (100%) ); |
| } |
| penguin .say( That's all, Goodbye ); duration = 5 seconds |
| } |