|
Putting all of that stuff into brackets is very nice and all, but to have the code actually do something, you must invoke the function. That will make the interpreter jump to the location of the subroutine, execute it, then come back to where it was working. Another way of thinking about it (though less accurate) is that the interpreter pastes the code of the subroutine everywhere that you call it. Functionally, however, the two views are the same -- every time you call it, the subroutine gets executed.
The syntax for calling a subroutine is easy -- simply prepend a & to the beginning of the its name. So calling the printStuff function from the previous example would look like:
&printStuff
Calls to subroutines can go anywhere where executable code can be placed, which makes them very useful.
|