ReadReg

System function.

The ReadReg function reads a string or an integer from the Windows Registry. Not available in WinTask Lite.

Syntax

ReadReg(<path>,<type>,<returned value>)
or
ret=ReadReg(<path>,<type>,<returned value>)

Parameters

<path>: entire path before the value (not the key).
For example :
"HKEY_LOCAL_MACHINE\SOFTWARE\TaskWare\WinTask\1.0\Name"

To read the default value of a key (named Default), use the entire path of the key and end with the character \

<type> can be :

1

string

2

string expand

3

binary

4

integer or dword

7

string multiple

If <type> is 1 or 2, a string is returned; if it is 7, a string is also returned but the binary zeroes separating the multiple strings are changed to \n\ and the ending double binary 0 is not returned. If <type> is 3 (binary), a string is returned containing a hexadecimal conversion of the binary value. A <type> of 4 returns an integer.

Return value

Ret, numeric return code. When the read is successful, the function returns 0, otherwise use this return code for Error Handling. If the return code is not zero, an empty or null value is returned in <returned value>.

Remarks

If there is an inconsistency between the specified <type> and the type of the returned value, a compilation error is generated.

Example

 

ReadReg("HKEY_LOCAL_MACHINE\SOFTWARE\TaskWare\WinTask\1.0\Name",1,name$)