Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter SixteenApplication (continued)

RegistrySetValue Function

Overview

The RegistrySetValue function sets a value in a specific key location. If the key location does not exist, it is automatically created.

Syntax/Parameters

Syntax

int = RegistrySetValue ( string key, string name, mixed value );

Parameters

key

A string containing the name of the key to access.

name

A string containing the name of the value to access. If the value is an empty string, the default value for the key is set.

value

The value to set. This can be any type of data except handle.

Return Value

An int value as ERROR_NONE or a formatted error code on failure.

Remarks

With the exception of a char or byte list, the value as an array is not presently supported

The registry data type is set depending on the value parameter as follows:

  Legato Data Type   Definition (WinSDK)   Description
  boolean   REG_DWORD   Logical TRUE / FALSE.
  char   REG_BINARY   Always treated as binary array of bytes.
  byte   REG_BINARY   Always treated as binary array of bytes.
  string   REG_SZ   Treated as a zero-terminated string.
  short   REG_DWORD   Converted to 32-bit unsigned number.
  int   REG_DWORD   Converted to 32-bit unsigned number.
  long   REG_QWORD   Converted to 64-bit unsigned number.
  float   REG_QWORD   Converted to 64-bit unsigned number. The floating-point format must be maintained when reading back the value.
  word   REG_DWORD   Converted to 32-bit unsigned number.
  dword   REG_DWORD   32-bit unsigned number.
  qword   REG_QWORD   64-bit unsigned number.

 

If a literal is supplied used as the value:

  Implied Data Type   Definition (WinSDK)   Description
  Integer (32-bit)   REG_DWORD   If the high 32-bit portion is 0x00000000 or 0xFFFFFFFF, the value is truncated and converted to a dword. This allows truncation of both positive and negative numbers that will fit into the 32-bit form factor.
  Integer (64-bit)   REG_QWORD   If the high 32-bit portion is not 0x00000000 or 0xFFFFFFFF, the value is stored as a qword.
  String (“data”)   REG_SZ   Treated as a zero-terminated string.
  Floating-Point (3.14)   REG_QWORD   Converted to 64-bit unsigned number. The floating-point format must be maintained when reading back the value.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic