Working with the Variable Processes Group

Navigation:  How to Work with Processes >

Working with the Variable Processes Group

Previous pageReturn to chapter overviewNext page

 

Process Purpose

 

The Variable group of processes allows for multiple operations that involve variables.

The results of these operations ("Insert"; "Extract"; "Assign"; etc.) are stored in variables.

 

 

A variable is a memory area in the device where data is stored temporarily. The content of a variable is an UNICODE character string that can be displayed on the device's screen, at any moment.

 

 

 

Variable Types

 

There are two different main groups of variables that can be used in a project:

 

User Defined Variables

The User Defined Variables are used to store data. They are created by the programmer to suit the needs of the application being developed. They include:

 

Global Variables

A Global Variable is defined in one program and can be used in any of the other programs or new projects. The contents can be retrieved, updated or modified by the other programs. (examples of variable codes: A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, B0, B1, B2…)

 

Program Variables

A Program Variable is defined in one program and cannot be used in any of the other programs. The contents can be retrieved, updated or modified only in the current program. (examples of variable codes: 0A, 1A, 2A, 3A, 4A, 5A, 6A, 7A, 8A, 9A, 0B, 1B, 2B…)

 

Local Variables

Local Variables are used in events associated to objects such as an "On Change" event. There are specific local variables associated to specific object events. The only exception is the "On RFID Tag Read" event. Even though this is a screen event, you can use local variables. These local variables provide information regarding the execution of the event.

Ex: Consider a "Variable Assign" process that you have added to an "On Change" event within a "File Browse" object. When assigning the appropriate variables, you will have access to specific pre-existing local variables such as "L_Record_Number" (which provides you with the number of the selected record).

 

System Variables

 

System Variable

The System Variables are not defined by the user. They contain system information that can be used by the programs in the application. System variables contain information such as current date & time, selected record number in a file browse object, battery level, program name and version. System variables are grouped in “Audio”; “Camera”, “Date”, “Device”, “GPS”, “Imager”, "RFID"; “Network”; "App_Info", “System”, "Timer", and "Operator" variables.

 

Some of the system variables that concern the "Operator" (X_USR_CUST1/X_USR_CUST2/X_USR_CUST3/X_USR_CUST4/X_USR_CUST5) are mapped with values that are defined/customized within the MCL-Mobility Platform (in the operator's profile). Refer to the MCL-Mobility Platform User Guide for more information on Custom Field Labels in the Operator Details page.

 

A program can contain Global, Local, Program or System variables.

A Global Procedure only allows for Local, Program or System variables.

Local Procedures use Global, Local or Program variables.

Regarding Routines (Routine and Routine In), they only allow for Global or Program variables.

 

 

All variables can, at any given time, be manipulated by the program to:

 

• Modify their content.

 

• Store data in a data file record.

 

• Send data to the host computer.

 

• Display data on the screen.

 

 

The and icons appear throughout the project. Clicking them provides access to a variables window with a list of variables (distributed over "Global"; "Program"; "Local" and "System" tabs). The availability of the tabs scope depends on the context. As mentioned above, not all variables are available for all programming contexts. In this window you can create new variables, and select the required one for the current process.

When clicking the icon, in a properties window, you are selecting the variable that will feed data to the process (the process will read data from this variable).

When clicking the icon, in a properties window, you are selecting the variable that will receive data after the process is run (the process will write data on this variable).

 

 

Detail of Variable Select Window

 

 

Depending on where it is called from, the Variable Select window will display the appropriate variable types(ex: Global, Program and System), each one in its scope tab.

 

Click each scope tab to open a table and view the corresponding variables and/or create more variables of that type.

 

Each scope tab table includes the following columns:

 

Id

NOT editable. Represents the variable's identification.

Name

Displays the existing variables. Use this column to create the necessary variables and/or to edit an existing variable. See To Select/Create a Variable below.

Init

If required, add initial values to your variable(s):

a. Select the row with the intended variable.

b. Click the corresponding "Init" field to set it to "edit" mode.

c. Enter the value.

d. Click to apply.

Template

Use this column to create a visual representation of a variable. Whenever a variable is displayed on the screen (within an object), instead of three asterisks (***), the object will display the template you entered. To add a template:

a. Select the row with the intended variable.

b. Click the corresponding "Template" field to set it to "edit" mode.

c. Enter the template for the variable.

d. Click to apply.

 

For organization purposes, when creating a template, consider the name of the variable and the values it will contain.

 

Category

Organize your variables into categories you create:

a. Select the row with the intended variable.

b. Click the corresponding "Category" field to set it to "edit" mode.

c. Enter the category for the variable.

d. Click to apply.

 

Once they are created, they will be available in the filter drop-down.

Description

If necessary, add information regarding each variable:

a. Select the row with the variable you want to describe.

b. Click the corresponding "Description" field to set it to "edit" mode.

c. Enter the information.

d. Click to apply.

 

If required, you can control the viewed information:

 

Use the "search box" to search for values in the "Name", "Category" and "Description" columns.

 

a. Enter the information in . The results are automatically displayed below.

b. To resume an unfiltered view, delete the information from the "search box".

 

Use the drop-down (to the right of the scope tabs) to filter the variables by category. A category created in the "Program" scope tab will only be available in the drop-down of that "Program" scope tab.

 

 

To Select/Create a Variable

 

After calling the "Variable Select" window by either clicking or (according to the available option), proceed as follows:

 

 

To select a variable, for whatever purpose: click the appropriate scope tab ("Global", "Program", "Local" or "System") to display its content.

Then, select a variable among the list available by clicking it.

 

To create a new variable, click the appropriate scope tab ("Global", "Program", "Local" or "System") and open it. Select a row and, then, click the "Name" field to set it to "edit" mode. Enter the variable name.

 

Finish the variable selection or creation by clicking to accept it and continue or click to abort the operation.

 

 

When creating/entering the name of a variable, take its purpose into consideration. It will help to identify its content, especially if there are a lot of variables. For instance, if the variable is designed to store the names of device operators, define it as "P_User_Name".

 

The name of a variable obeys a specific syntax that immediately defines the scope. It, automatically, starts with a P_(if it is a "Program" variable), an L_(if it is a "Local" variable or a G_(if it relates to a "Global" variable"). Spaces are, also, replaced by an underscore.

 

 

The Variable group is divided into:

 

----- Operation

Working with Assign Process

Working with Combine Process

Working with Substring Process

Working with Extract Process

Working with Length Process

Working with Parse String Process

-----Format

Working with Format String Process

Working with Format Numeric Process

Working with Conversion Process

----- Edit

Working with Insert Process

Working with Delete Process

Working with Remove Process

-----Search

Working with Search Process

Working with Search/Replace Process

----- Special Parsing

Working with JSON to Variable(s) Process

Working with JSON to File Process

Working with XML to Variable(s) Process

Working with XML to File Process