Tuesday, October 18, 2011

RAPTOR SKILL - Procedures

A simple RAPTOR program has just one set of symbols in a tab called main. More advanced RAPTOR programs have additional sets of symbols, each in its own named tab. These additional sets can be either subcharts or procedures. This posting concerns procedures. Procedures are termed functions or subroutines in some other programming languages. What makes a procedure special is that it...

  • can receive one or more parameters (values or variables).
  • can process the parameters in some desired way with RAPTOR symbols.
  • can "toss" back parameters to the main program on finishing.
Creating a Procedure
A procedure is created by right-clicking on the main tab. When you do, a dialog box will appear so you can define the procedure by...
  • naming the procedure. Choose a name that is descriptive of its functionality.
  • naming the parameter(s) the procedure needs to do its job.
  • specifying each parameter as either input or output, or both.
Procedure Example
The graphic below shows a dialog box that is creating a procedure named circleArea. The procedure will use an input parameter named radius and an output parameter named area. View the video near the end of this posting to see how this procedure was defined and used.
Another Example Procedure
The following graphic shows another procedure named squareNumber that takes only one parameter named number, but number will be both passed to the procedure as input and passed back as output.
Coding a Procedure
Only one additional symbol, an assignment that squares the number, is required to define the squareNumber procedure above. Here are the symbols in the procedure. Note the in and out for the number parameter.
Calling a Procedure
Here is how the squareNumber procedure is used in the main tab, and the output of the program. A Call symbol is used to execute the procedure. Note that "number" has been transformed from 8 to 64.
Video about Procedures
Please view the following YouTube video to see how the circleArea procedure (the first graphic in this post) was created and used in a program. Access the video directly on YouTube at