Skip to content
Jaume Olivé Petrus edited this page Oct 30, 2017 · 12 revisions

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.

Clone this wiki locally