Site icon TestingDocs.com

Flowgorithm Pass By Value Example

Overview

In this tutorial, we will learn Flowgorithm Pass by Value concept using an example. Flowgorithm functions allow flowcharts to reuse code and abstract complex logic into smaller modules. We can convey the information to the function using the function parameters. They are several methods to pass the parameters. The most common are as follows:

Pass By Value

In this approach, we will invoke the Flowgorithm function by passing the values to the function. In this mode, we will give the values directly to the function and the values are copied to the stack location.

Pass by value method ensures that the function/procedure will not change the value of a variable passed to a parameter.

Example

Let’s look at a simple example to understand the concept. Define a function called sum() with two parameters: a and b. The data types of the function parameters are Real. The function adds the parameters and stores the value in the variable result.

The Main function invokes the sum() function using the pass-by-value approach.

In the example, the Main() function invokes the sum() function with values: 3.2 and 5.6

The values are copied to the function parameters a and b respectively. The function parameters scope is limited and is local to the function sum().

The Breakpoint statement is used to temporarily pause the flowchart execution to show the values in the Call Stack.

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Exit mobile version