Skip to content

Variables🔗

Preview restriction

HDevelopEVO does not support global variables yet.

The names of variables are built up by composing letters, digits, and the underscore _.
The type of a variable, iconic or control variable, depends on its position in the parameter list in which the variable identifier is used for the first time, and is determined during the input of the operator parameters. For more information, see also Basic Types of Parameters.

Whenever a new identifier appears, a new variable with the same identifier is created. Control and iconic variables must have different names. The value of a variable is undefined until the first assignment defines it. Note that the variable has not been instantiated yet.
A read access to an undefined variable leads to a runtime error.

Instantiated variables contain tuples of values. Depending on the kind of the variable, the data items are either iconic objects or control data. The length of the tuple is determined dynamically by the performed operation.
A variable can get new values any number of times, but once a value has been assigned, the variable will always keep being instantiated, unless you reset the program execution by clicking .
The content of the variable is deleted before the variable is assigned new values.

Variable types🔗

The concept of different types of variables allows a first (“coarse”) typification of variables (control or iconic data), whereas the actual type of the data – for example, real, integer, string etc. – is undefined until a concrete value is assigned to the variable. Therefore, it is possible that the data type of a new data item differs from that of the old one.

In HDevelopEVO, the type of a variable is defined in these different ways:

  • procedure parameter definitions (explicitly)

  • usage in the code (implicitly)

The order of precedence is as follows:

  1. Procedure parameter definitions

  2. Usage in the code

In the latter case, the type of a variable is defined by those code lines, where the value of the variable is used and where the exact type of the new value is known before run time.

Within its scope, a variable must always be properly defined. The following type definition errors are possible:

  • A local variable is used, whose type has not been defined before.
    ⇒ The error ‘The variable never gets initialized’ [21089] is thrown. All lines using the variable become invalid, and the variable is not displayed in the variable window.

  • The type of a variable is defined differently, for example, as iconic variable and later as control variable.
    ⇒ The error ‘The type of the variable could not be determined (conflicting type definitions found)’ [21088] is thrown. All lines using the variable become invalid, and the variable is not displayed in the variable window.

  • The type of a variable is properly defined, but used in the wrong context, for example, an iconic variable is used as a control input parameter.
    ⇒ The error ‘The type of the variable could not be determined (conflicting type definitions found)’ [21088] is thrown. Only the affected code becomes invalid.