9 128 GET_REGISTRY_VALUE

LANSA Technical

9.128 GET_REGISTRY_VALUE

Þ Note: Built-In Function Rules.

Processing

Returns the Value for the specified Registry Key.

When the length of an Argument is stated as being greater than 50, this is only true for Fields. Literal values are restricted to a maximum length of 50. This is especially true for the three arguments in this BIF. All the arguments are limited to a length of 50 unless a field is used.

For use with

LANSA for i

NO

Visual LANSA for Windows

YES

Visual LANSA for Linux

NO

 

 

Arguments

No.

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

R

Registry Root

e.g. HKEY_CLASSES_ROOT,HKEY_LOCAL_MACHINE

1

256

 

 

2

u

R

Registry Path

e.g. WinZip\shell\open\command

1

256

 

 

3

u

O

Registry Key Name

If not specified the (Default) value for the specified path will be returned, otherwise specify the name of the key.

1

256

 

 

4

N

O

Registry Hive to use: 32 or 64
Any other value will use the default for the application. That is, a 32 bit application will write to wow6432 while a 64 bit application will write to wow6464.

This argument is ignored on a 32 bit operating system.

1

4

0

0

 

 

Return Values

No.

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

X

R

Registry Key Value
Refer to Key Value Note for details.

1

Unlimited

 

Unlimited

2

A

R

Return Code

OK – Key found and Value Returned
ER – Key could not be found

2

2

 

 

3

A

O

Value Type

S – String
B – Binary
D – DWORD
X – Expanded string. Can contain environment variables which will be expanded on return from this Built-In Function.

1

1

 

 

 

 

Key Value Note

If a field value is saved by PUT_REGISTRY_VALUE, a field with the same type must be used to get the correct value by GET_REGISTRY_VALUE.

The table shows the supported field types for each key type.

Key Type

Supported Field Types

S & X

Alpha, BLOB, Boolean, Char, CLOB, Date, DateTime, Float, Integer, Packed, Signed, Time and Char.

B

Binary, VarBinary, Alpha, Char and String.

D

Alpha, Char, String and less than 8 bytes Integer.

 

Example

Values PUT and the returned value on a GET from the Registry.

Data Type

PUT

GET

S

ABC1234

ABC1234

D

7000

7000

D

9999999999

0 (the biggest number for DWORD is 4294967295)

D

–12

-12

B

AAAAA

AA AA 0A

B

WEWE

0E 0E (because 'W' is not a HEX number)