-
// generate the main menu
include ("include/vcc_menu.php"); ?>
// select and link a stylesheet include ("style/style.php"); ?>
// end of #mainmenu ?>Lets make the behaviour a little more interesting by adding a block that adds one to any message it receives. Now suppose that we want to re-use this behaviour as part of a larger behaviour. To do this, we must create a single symbol to represent the double behaviour.
At present, we will not be able to send or receive messages from outside the behaviour because it has no external ports. An external port to send integers out of the behaviour can be added by clicking behaviour/output port and clicking on the behaviour canvas. Finally this should be linked with a wire to the existing port.
We'll also delete the source block and add an external input port so that messages can be received from a higher-level behaviour. The behaviour should now look as shown on the right.
Now we can create a symbol to represent the behaviour as follows:
To use the new symbol, create a new behaviour and add the symbol to it by dragging the word "Symbol" from tutorial_2002/double to the behaviour background. You may need to refresh the library list by double right-clicking and choosing refresh.
You can now use the double symbol like any other block. To view the underlying behaviour, just double click on the block and select "behv" from the list of views.