Working with Procedures

Navigation:  How to Work with Programs >

Working with Procedures

Previous pageReturn to chapter overviewNext page

 

Overview

 

There are two types of procedures:

 

1. Local Procedures

A specific set of commands (processes), inside a program, that uses local, program or global variables to manipulate data. The local procedure can only be called inside the program it is contained in.  

When creating a local procedure, you can define input and output parameters that are shared with the processes that call that local procedure.

See Local Procedures.

 

 

2. Global Procedures

A specific program used for recurring actions and can be reused in other projects.

This procedure does not use global variables to prevent conflicts with global variables being used in a program.

It can contain screens, controls, routines and local procedures. Basically, it can be considered as a standard program.

To exchange data between the program that called this procedure and the global procedure, it is mandatory to define "input" and "output" parameters.

A global procedure is reusable, meaning, you can create a global procedure in an MCL-Designer V4 project, export it into Library and, then, import it into other MCL-Designer V4 projects.

See Global Procedures.

 

 

If required, you can use the following shortcut to include a global or a local procedure to certain elements: a screen, a "routine in", a "routine out" or a control:

If you drag a previously created local procedure from the "Programs" tab onto a screen/control (specifically, the "Actions" tab) or a "routine in"/"routine out" (onto its "Routine" tab), it automatically adds a "call a Local Proc" process. See Working with Call Local Proc Process.

The same goes for the global procedure - if you drag one from the "Global Procedures" module onto those elements, with the addition of the "Event" tab of a global event, you will be adding a "Call Global Procedure" process to the intended element. See Working with Call Global Proc Process.