-
Notifications
You must be signed in to change notification settings - Fork 18
Script
A script is a collection or stack of block that all interlock with one another.
Only scripts that begins with a Hat block are executed at some time.
In the following example when the board is started an script is executed:
The above script prints to the screen:
Hello World
Hi
Hi
Run this example in The Whitecat IDE.
Scripts that not begins with a hat block are considered as a test scripts and are ever executed. This is a common practice in block programming and is used to record that at some point the programmer tested a script. The equivalence in classic programming is to comment a part of code.
In the following example when the board is started an script is executed:
The above script prints to the screen:
Hello World
Hi
Hi
Note that "This is never printed" is not printed to the screen, because the script not begins with a hat block.
Run this example in The Whitecat IDE.