Microsoft Small Basic
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

SubRoutines

RSS
Modified on 2010/10/18 06:05 by 216.41.197.192 Categorized as Uncategorized
Sometimes it's convenient to be able to refer to other recipes. In programming this is done via a subroutine.

Translating a recipe call is the easiest of them all. Let's say we have a line like

 'draw a square (recipe below) 

First, remove the spaces to create a recipe label, then add () to call it.

 drawASquare() 

Of course it's not enough just to call it, we will also need to define the subroutine later

 'Recipe for drawASquare
 ' do stuff

Here we use the Sub command

 Sub recipeName
    ' do stuff
EndSub 

Then we need to replace the 'recipeName' with the label we created earlier (drawASquare)

 Sub drawASquare
    ' do stuff
EndSub 

Couldn't be easier!

ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.