Site icon TestingDocs.com

Procedure in Raptor flowcharts

Introduction

In this post, we will learn to use a procedure in Raptor flowcharts. A procedure is a series of steps, to achieve some desired result or to perform a specific task. We rely on the procedure to perform the task and don’t worry about internal details or the implementation. This is called Procedural abstraction. Procedural abstraction hides the internal details or working from the caller.

Procedure vs Function

It’s important to note the difference between a Procedure and a function. A Procedure does a set of actions and doesn’t return any value to the caller. A Function is like a Procedure but returns a value to the caller or the main flowchart.

For example, RAPTOR in built function sqrt() returns a value i.e the square root of the number passed to the function.

 

The values passed to the procedure or function are called as arguments or parameters.

Flowchart Example

In this example, we will create a procedure to calculate the area of a rectangle. We will pass the length and width in meters as parameters to the procedure from the main flow chart. The procedure calculates the area of the rectangle the value is used in the main flow chart.

Create a RAPTOR Procedure

 

 

In the Raptor flowchart, we add both Procedure and Function using the same menu option.

 

 

Procedure parameters

There are two types of parameters that we can specify to a Raptor procedure. Input and Output parameters.

https://www.testingdocs.com/parameter-scope-in-raptor-procedure/

 

 

Invoke the Procedure

We can invoke the procedure in the flowchart using the Call symbol. To call the procedure drag the Call symbol in the main flow chart. Since procedures do not return value they can only be invoked using the Call flowchart symbol.  Pass the parameters.

RectangleArea(length,width,area)

 

 

Math Formula

The area of a rectangle is

Area= length * width

The output parameter area is computed in the procedure.

area <- l*w

Drag an output symbol to display the area in the main flow chart.

 

 

Click on the execute button to test the flow chart.

 

 

You can see that we have calculated the area of the rectangle using a Procedure in the flow chart.

Sample Procedure Use-case

We can implement a large flowchart or program into a modular sub-modules using procedures and functions. Each procedure body is small and performs a specific task when invoked. Let’s take a telephone directory as an example. There are many features of a telephone directory system.

Some of the main features are adding, listing, searching, modifying and deleting telephone directory-related records. A record contains the information of a person’s name, phone number and address etc. All these operations can be performed by using different procedures in the flowchart.

We can develop Procedures for:

Advantages of using Procedures

 

RAPTOR Tutorial Page: https://www.testingdocs.com/raptor-a-flowchart-tool/

RAPTOR official website: https://raptor.martincarlisle.com/

Exit mobile version