RegistryItem.Value

From Xojo Documentation

Method


RegistryItem.Value(Name as String) As Variant

Supported for all project types and targets.

Gets the RegistryItem value using its Name and returns the value as a Variant. See the Notes section for RegistryItem.

If the value does not exist, nil is returned.


Method

RegistryItem.Value(Index as Integer) As Variant

Supported for all project types and targets.

Gets the RegistryItem value using its Index and returns the value as a Variant. If Index is greater than KeyCount, then an OutofBoundsException is raised.


Method

RegistryItem.Value(Name as String)

Supported for all project types and targets.

Sets the RegistryItem by the passed Name.


Method

RegistryItem.Value(Index as Integer)

Supported for all project types and targets.

Sets the RegistryItem value by the passed Index. If Index is greater or equal than KeyCount, then an OutofBoundsException is raised. Index is zero based.

Notes

When assigning Integer literal values, keep in mind that the Integer type size varies between 32-bit and 64-bit builds. In 32-bit builds, an Integer literal is 32-bit which results in a DWORD value set. In 64-bit builds an Integer literal is 64-bit which results in a QWORD value set. If your Registry value needs to be a DWORD in a 64-bit app, be sure to specifically set the Integer value type to 32-bit. You can do this using a specifically typed variable or the CType command:

// Use specific type
Var value As Int32 = 1100
reg.Value(App.ExecutableFile.Name) = value

// Set type using CType
reg.Value(App.ExecutableFile.Name) = CType(11000, Int32)

Examples

To create a binary key, use a MemoryBlock:

Var mb As New MemoryBlock(1)
mb.Byte(0) = 15
reg.Value("Key") = mb