Next Topic

Previous Topic

Book Contents

EnumValue

bool EnumValue(string &sValueName)

Return values

Non zero if the function is successful; otherwise 0, and an error description can be retrieved by calling GetErrorDescription().

Parameters

Remarks

Call this function until it returns false to enumerate all values in the current key. Before this function is called the first time, a call to BeginEnumValue() must be made.

Example 1

--KNM Lua API example (C) 2007 Kaseya AB
--Demonstrates the Lua Windows Registry interface
Reg = TLuaRegistry();
--Open the key to enumerate
if Reg:Open(Reg.LOCAL_MACHINE,"SOFTWARE\\Kaseya") == true then
	Reg:BeginEnumValue();
	bOk = true;
	repeat
		sValue = "";
		bOk,sValue = Reg:EnumValue(sValue);
		if bOk then print(sValue); end;
	until bOk == false;
else
	print("Failed to open the key");
end