Beruflich Dokumente
Kultur Dokumente
The six symbols used in Raptor are displayed in the Symbol Window in the upper left corner of the main
window:
Assignment
The assignment symbol is used to change the value of a variable. The right hand side of the assignment is
evaluated, and the resulting value is placed in the variable on the left hand side. For example, consider the
case where the value of x is currently 5, and the assignment "x <- x + 1" is executed. First "x+1" is
evaluated, yielding the result 6. Then the value of x is changed to be 6. Note that assignment is very different
from mathematical equality. The statement should be read "Set x to x+1" instead of "x equals x+1". The
assignment symbol can also be used to assign a string expression to a string variable (see String Variables &
Assignment).
Call
The call symbol is used to invoke procedures such as graphics routines and other instructor-provided
procedures. The call symbol is also used to run subcharts included in a Raptor program..
Input
The input symbol is used to ask the user for a number or string while the flowchart is executing. When an
input symbol is executed, the user will be prompted with a dialog to enter a value that can be interpreted as
either a number or string, depending on what the user types (see String vs. Numeric Input). The user can
also override the source for input by specifying a text file to be used in place of the keyboard (see Inputting
from a File)
Output
The output symbol is used to either write a number or text to the Master Console window. The user can also
override the destination for output by specifying a text file to be used instead of the Master Console (see
Outputting to a File).
Selection
The selection structure is used for decision making. The programmer enters in the diamond an expression
that evaluates to Yes (True) or No (False). Such expressions are formally referred to as Boolean expressions.
Based on the result of the expression in the diamond, control of the program will branch either left (Yes, or
True) or right (No, or False). For more information, see Boolean Expressions.
Loop Control
The loop structure is used to repeat a sequence of symbols until a certain condition is met. When execution
reaches the bottom of the loop, it starts over again at the top. The loop is exited when the diamond symbol is
executed and the Boolean expression in the diamond evaluates to Yes (True). Again, more information can
be found in Boolean Expressions.
Watch window
The Watch Window gives the user feedback on the values of all variables and arrays as a flowchart executes.
Variables are arranged in the Watch Window in the order in which they are encountered as the flowchart
executes. The variable being changed by the statement currently executing in the flowchart is shown in red.
Arrays are initially displayed minimized. To view the value of individual elements of an array, the user should
click on the "+" symbol to the left of the array name. The values can be later hidden by clicking on the "-"
symbol.
Note: nothing is displayed in the Watch Window until a variable or array is encountered during the execution
of a flowchart.
The image below is an example of how a two-dimensional array will appear in the Watch Window. Each row
receives its own "+" sign that can be changed into a "-" sign (and vice versa) by clicking on the sign. The row
number is indicated in brackets ("<1>", "<2>", etc.).
When the row has been expanded so that the "-" sign is showing, the number of columns is indicated next to
the word "Size", followed by the individual values that have been assigned for that row. The "column" number
precedes the value and is indicated in brackets. For example, the Watch Window displayed below indicates
that the value of Test_Scores[2,4] is 92 (in other words, 92 is the value at row 2 and column 4 of array
Test_Scores). Also note that the array name, row, and column for Test_Scores[2,4] is highlighted in red,
which indicates that this value is being changed by the statement currently executing in the flowchart.
Raptor workspace
The Workspace is where flowcharts are built and executed. Initially, each flowchart contains just a Start and
End block in a "main" tab. The programmer may add subcharts, and these subcharts will initially contain just a
Start and End block. The Start and End blocks may not be deleted from any chart or subchart.
To construct a flowchart, click on one of the six symbols to the left of the Workspace and then click (not drag)
an insertion point somewhere in the existing flowchart.
An insertion point is indicated when the cursor changes to
. The symbol is then added to the existing
flowchart in place. Alternatively, you can right click on an insertion point and insert a symbol by selecting from
the menu.
As the flowchart grows in size, scrollbars will appear that enable you to look at portions of the flowchart that
are off screen. You may also change the scale factor for the flowchart to view more (or less) of the flowchart
at one time.
Once symbols have been added, they may be edited in several ways. Right-clicking on a symbol provides
several editing options to the user:
Double-clicking a symbol allows the user to change what will happen when that symbol is executed (i.e.
change the assignment, procedure call, boolean expression, etc.)
Multiple symbols can be selected at one time by left-click dragging a selection box over several symbols. The
selected symbols are displayed in red. The selected symbols may then be edited using the menu, toolbar, or
pop-up menu.
When a program is executing, the Workspace window displays the currently executing instruction in green.
Undo reverts the flowchart back before the last change was made.
Redo cancels the previous undo operation.
Comment allows the user to add a comment to a symbol.
Cut, Copy, and Delete all function as expected on any selected symbols (those currently colored red)
Paste can be performed only after the user has specified an insertion point with a left mouse click. Note that
when the cursor is at an insertion point, the cursor will change to
. After the insertion point identification
and selection of Edit-Paste, the symbol(s) earlier copied or cut to the clipboard will be inserted.
Select All allows the user to select the entire program for copying, cutting, etc.
The Scale menu allows the user to change to scaling factor of the Workspace.
Step executes through one shape in a flowchart. Pressing F10 will also execute the current shape.
Execute to Completion runs the entire program until it terminates.
Reset halts program execution and clears the value of all variables.
Reset/Execute halts program execution, clears the value of all variables, and restarts execution from the
beginning.
Pause temporarily halts the execution of a program until execution is resumed by the user.
Clear all Breakpoints removes all currently set breakpoints to allow the current program to execute until it
terminates.
Tile Vertical puts the Raptor Workspace Window and the Raptor Master Console window side-by-side on the
Windows desktop.
Tile Horizontal puts the Raptor Workspace Window above the Raptor Master Console window on the
Windows desktop.
Building a flowchart
To build a flowchart, left click on a symbol in the Symbol Window. Move the mouse to the place in the
flowchart where the symbol belongs. You may need to move the cursor slightly to find an insertion point.
When the cursor is at an insertion point, the cursor will change to
. When the left mouse button is clicked at
an insertion point, the selected symbol is added to the existing flowchart at the specified location.
If symbols are incorrectly placed, select Undo, Delete, or Cut from the Edit or Right Mouse Button menu.
Symbols may also be copied and pasted in another area of a flowchart.
Once a symbol has been correctly placed, double click the symbol to edit its contents.
Executing a flowchart
A flowchart may be executed using the Run Menu/Execute option or the toolbar. The symbol being executed
is highlighted in green. Any variables changed by the execution of a symbol are highlighted in red in the
Watch window.
Step executes through one shape in a flowchart. Pressing F10 will also execute the current shape.
Execute to Completion runs the entire program until it terminates.
Reset halts program execution and clears the value of all variables in preparation for a subsequent
execution.
Reset/Execute halts program execution, clears the value of all variables, and restarts execution from the
beginning. Pressing F5 will also perform this function.
Pause temporarily halts the execution of a program until execution is resumed by the user.
Speed Slider sets the speed of program execution. When the slider is entirely to the right
(maximum speed), the Watch Window is not updated and flowchart symbols are not highlighted during
execution.
Editing Symbols
Double click a symbol placed in a flowchart to edit its contents.
Assignment
The following dialog appears when editing an assignment symbol:
In the box following "Set", enter a variable. In the box following "to", enter an expression whose value will be
stored in the given variable. If the variable is a string variable, the expression on the right must be a string
expression (see String Variables & Assignment).
Input Symbol
The following dialog appears when editing an input symbol:
Enter a prompt to the user in the first textbox. The prompt will appear in the pop-up window in which the user
will enter a value for the variable whose name is specified in the second textbox. You may select the
Expression radio button if you want the prompt to be a string expression that contains a string variable or
concatenation of several string expressions. Depending on what the user enters during program execution,
the variable (in the above example, Age) may be treated as a number or string (see String vs. Numeric Input).
Output Symbol
The Output Symbol specifies what will be output to the Master Console (or, in some cases, to a file; see
Outputting to a File). First select whether an Expression or Text is to be output. An expression can be a
number, a string literal in double quotes, a variable, a math expression, or a string expression. Select Text to
output a text message containing no variables or math; no quotes are required. If the "End current line"
checkbox at the bottom of the dialog is checked, the MasterConsole output after this one will start on the next
line.
Selection Symbol
The following dialog appears when editing the decision diamond for a selection structure:
Enter in this textbox a Boolean expression that will be evaluated for this symbol. If the Boolean expression is
true, the left branch of the selection will be taken. Otherwise, the right branch will be taken.
Loop Symbol
The following dialog appears when editing the decision diamond for a loop structure:
Enter in the textbox a Boolean expression that will be evaluated for this symbol. If the Boolean expression is
true, the loop is exited. Otherwise, flow continues on the "No" branch below the diamond and eventually to the
The small textbox at the bottom of the MasterConsole window allows the user to directly input statements and
commands during execution. For example, the user may want to see what a RaptorGraph operation will do by
typing in a procedure call in this textbox (e.g. "Open_Graph_Window(300,300)").
The Clear button clears the MasterConsole window.
select_collapsed.bmp
select_before_collapse.bmp
symbol.
Again, the
clicking on the
loop_before_collapse.bmp
to this:
loop_collapsed.bmp
symbol next to the diamond shows that the view is collapsed. The view can be expanded by
symbol.