Local Procedures

Navigation:  How to Work with Programs > Working with Procedures >

Local Procedures

Previous pageReturn to chapter overviewNext page

 

Overview

 

A Local Procedure is a sequence of processes that acts within a program/global procedure and can only be called by that same program/global procedure.

It uses Local or Program variables to manipulate data.

 

 

To Add a Local Procedure to a Program

 

Step-by-step

 

1. Use one of the following to add a local procedure:

 

a. In the "Programs" module, right-click the program that will include the local procedure.

 

 

b. In the "Programs" module, right-click the "Local Procedure's" general entry.

 

 

2. In the resulting menu, click the “Add Local Procedure” option. This opens the local procedure's properties window.

 

 

3. In the "General" tab (open by default), enter a name for the newly created "Local Procedure" in the "Name" box. This name will be displayed in the tree view of the "Programs" module.

 

4. If necessary, add notes concerning the local procedure in the "Notes" box.

 

5. Go to the "Param In" tab.

 

 

6. Define the input parameters for the local procedure in the columns:

"Input Param Var"

Define the local variable(s), within the local procedure, that receive data from outside, with the use of variables. See Working with the Variable Processes Group.

 

"Input Param Default Value"

Optionally, define the value(s)/variable(s) that are assigned to the "Input Param Var", in case the calling process does not map them.

 

"Description"

As an option, use the third column to add any relevant notes.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

7. Go to the "Param Out" tab.

 

 

8. Define the output parameters for the local procedure.

"Output Param Var" – define the local variable(s) within the local procedure, that will return data to the program that called the local procedure.

 

"Description"

As an option, use the third column to add any relevant notes.

 

Use the editing icons to the right of the table to move the rows up and down and to delete or add more rows.

 

9. Open the "Procedure" tab.

 

 

10. Add the required processes. See Adding Processes to a Routine, "Routine In", "Routine Out", Local Procedure or Global Event.

 

Always end with a "Go to <End of Procedure>" process. This will return the program to the line, immediately below, that, initially, called for the local procedure.

 

 

 

11. Click to conclude the local procedure addition OR  click to abort the operation.

 

 

To Call a Local Procedure

 

This operation can be executed in the "Actions" tab, the "Routine" tab or the "Event" tab of the element that calls the local procedure.

 

Step-by-step

 

1. Add a “Branch Process – Call Local Proc”. See Working with Call Local Proc Process.

 

2. This opens the following window:

 

 

3. In the "Procedure's" drop-down, select the local procedure to be called.

 

4. The "Param In" automatically displays the parameters established in the properties window ("Param In" tab).

Define the value(s)/variable(s) to be sent to the local procedure (mapping of the local procedure's input parameters) in the second column of the upper table.

 

5. The "Param Out", also, displays the parameters established in the properties window ("Param Out" tab).

Define the variable(s) that return(s) data from the local procedure (mapping of the local procedure's output parameters) in the second column of the lower table.

 

Clicking (located on the window's upper right corner), enables the creation of a local procedure. See To Add a Local Procedure to a Program.

 

 

6. Click to apply these choices and return to "Actions" tab, the "Routine" tab or the "Event" tab that initiated this operation.

 

7. Click the tab's to conclude

 

 

To Add Components to a Local Procedure

 

In the "Global Procedures" module, right-click the global procedure (represented in the tree view) and select the component to add.

 

Edit

Opens the selected local procedure's properties window.

Copy

Copies the selected local procedure.

Duplicate Local Procedure

Duplicates the selected local procedure with all its features, controls and processes.

Delete

Deletes the selected local procedure.

Convert to Global Procedure

Converts the selected local procedure into a global procedure with all its features, controls and processes. The selected local procedure is automatically moved into the "Global Procedures" module (the "Programs" module closes and the "Global Procedures" module opens). See Global Procedures.

Param In

Provides direct access to the "Param In" tab.

Param Out

Provides direct access to the "Param Out" tab.

Procedure

Provides direct access to the "Procedure" tab.