In this tutorial, we will learn how to invoke or call a function using the Flowgorithm flowchart tool. Flowgorithm flowchart tool allows us to create our own functions. These are also called user-defined functions.
Functions are an independent piece of code that performs a specific task for the caller. i.e Main flowchart.
- Subroutines/Procedures – do not return any value to the main flowchart.
- Functions return a value to the main flowchart.
Add a Function in Flowgorithm
We must define the function before calling it. Steps to add a function in the Flowgorithm tool are as follows:
Launch the Flowgorithm flowchart tool.
Click on the down arrow mark beside the Main flowchart drop-down.
We can add a function by clicking Add Function… option.
or Choose from the Menu bar Program >> Add Function…
Alternatively, we can use the Function manager to create a Function. Click on the Function Manager… button.
Click on the Add button to add a new Function to the Flowgorithm flowchart.
In the Function Properties window, you can specify the function details.
Calling a Function
Calling the function is by its name and passing the required parameters. In an Assignment symbol we can assign the return value of the function. For example, to call a function Fact() which has one parameter:
myVar = Fact(x)