Click or drag to resize

SetRTRegInt Function

X#
Save a numeric value to the Registry.

Namespace:  XSharp.VO
Assembly:  XSharp.VO (in XSharp.VO.dll) Version: 2.19
Syntax
 FUNCTION SetRTRegInt(
	cSubKey AS STRING,
	cKey AS STRING,
	dwKeyValue AS DWORD
) AS LOGIC
Request Example View Source

Parameters

cSubKey
Type: String
cKey
Type: String
The key under which you want to add the number.
dwKeyValue
Type: DWord
The key value you want to add to the Registry.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
Remarks
SetRTRegInt() can be used to save runtime settings into the Registry.
The value will be saved as cKey = dwKeyValue under the following key: HKEY_CURRENT_USER \\Software \\ComputerAssociates \\CA-Visual Objects Applications \\cSubkey and optionally under HKEY_LOCAL_MACHINE \\Software \\ComputerAssociates \\CA-Visual Objects Applications \\cSubkey If cSubkey is empty (NULL_STRING), the Registry entry will be saved without a subkey under: HKEY_LOCAL_MACHINE \\Software \\ComputerAssociates \\CA-Visual Objects Applications SetRtRegInt() only writes to HKEY_LOCAL_MACHINE if the key already exists (and ignores write errors). It always writes to HKEY_CURRENT_USER as well. The return value reflects the result of the write operation to HKEY_CURRENT_USER
Examples
This example adds the entry LOCK_RETRIES = 10 to the Registry under the subkey SSA:
X#
 1SetRTRegInt("SSA", "LOCK_RETRIES", 10")
 2...
 3nRetries := QueryRTRegInt("SSA", "LOCK_RETRIES")
 4DO WHILE nRetries > 0
 5    IF RLock()
 6        EXIT
 7    ENDIF
 8    nRetries--
 9ENDDO
10IF nRetries = 0
11    // Error message
12ENDIF
13...
See Also