Usage
Reads a string or an integer from the Windows Registry.
Note: Not available in WinTask Lite. Use all registry functions with caution. If you are unfamiliar with the Windows Registry, we recommend that you do not use these functions. Removing or modifying a registry entry can cause your system to become unstable.
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
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$)