You are here: Core Reference > Coding > Scripting > GetRegistry

GetRegistry

The GetRegistry function allows a script to retrieve a value from a registry

Syntax

GetRegistry (Name, Default)

Description

Reads a value from a registry.

Arguments

Name {string}

The Name defines the entry in the registry that is to be read by the script. The Name you enter has to match the name of the required registry.

 

Default {string or integer}

The Default value is an optional variant and is used to define the value that will be used if the script cannot find an entry in the registry.

Returns

Returns a string or integer value from the registry.

NOTE: The registry values are usually stored in the
HKEY_CURRENT_USER\Software\Schneider Electric\ClearSCADA\ViewX/Mimics key in the registry on your client PC.

Example:

RegValue = GetRegistry("CoreReg", 17)

This sets the RegValue variable (defined earlier in the script) to have the same value as the value stored in the CoreReg registry. If the script cannot find a value in the registry, the value 17 is used instead and is also created in the registry.


ClearSCADA 2015 R2