Registry.GetValueType

number Registry.GetValueType ( 

number MainKey,

string SubKey,

string Value )

Example 1

value_type = Registry.GetValueType (HKEY_LOCAL_MACHINE, "Software\\My Application", "InstallPath");

Gets the type of data stored in the "InstallPath" value located at "HKEY_LOCAL_MACHINE\Software\My Application" and stores the corresponding numeric constant in value_type. If the "InstallPath" value was of type REG_SZ, the number 1 would be returned.

You could test the return value with an if statement, like this:

if value_type == REG_SZ then

  -- only do this part if the InstallPath Registry value
  -- at HKEY_LOCAL_MACHINE\Software\My Application
  -- is of type REG_SZ (a string)

end

See also:  Related Actions