« Back to Product

Documentation

RegisterVariableString

Require: IP-Symcon >= 4.0

 variant RegisterVariableString (string $Ident, string $Name, array $Presentation, int $Position) 

Parameters

Ident

Ident of the status variable

Name

Name of the status variable

Presentation

The configuration of the display as an array. A profile can be set via the Legacy profile.
Default == ""

Position

Position in the object tree and therefore also in the visualization.
Default == 0

Returns

Class Type Description
IPSModuleStrict boolean Returns whether the variable was created. The return value can be used, for example, to set an initial value.
IPSModule integer Variable ID of the created status variable.

Description

This function creates a status variable of type String with the ident Ident and the name Name. You can also specify which Presentation is to be used and at which Position the status variable is to be placed.

The structure of the presentations is described in more detail here.

Warning

Presentations can be used from version 8.0. In previous versions, profiles can be set as a string via the Presentation parameter

Example

// IPSModuleStrict
$created = $this->RegisterVariableString("Name", "My Name", ["PRESENTATION"=> VARIABLE_PRESENTATION_VALUE_INPUT]);
if ($created) {
    // Set initial value
    $this->SetValue("Name", "Peter");
}

// IPSModule
$variablenID = $this->RegisterVariableString("Name", "My Name", ["PRESENTATION"=> VARIABLE_PRESENTATION_VALUE_INPUT]);
Any questions?