I need a little help, i'm trying to read a boolean value from the registry, but everytime it gets converted to true.
I tried lots of things like implicit conversion but even that didn't help, only thing I havn't tried is
Matty's Registry Module
Here's a piece of my code
code:
//First some classes so we can easily create objects later
function preferences()
{
this.percentage = new Boolean(true);
this.cols = 3;
}
//Then we create the objects
var preferences = new preferences();
//The actual reaing of the variable in the registry
preferences.percentage = ReadRegistry("\preferences\\percentage");
//The actual saving of the variable in the registry
WriteRegistry("\preferences\\percentage", preferences.percentage);
//Functions to do the saving and reading
function WriteRegistry(key, value)
{
var Shell = new ActiveXObject("WScript.Shell");
return Shell.RegWrite(MsgPlus.ScriptRegPath + Messenger.MyEmail + "\\" + key, value);
delete Shell;
}
function ReadRegistry(key)
{
var Shell = new ActiveXObject("WScript.Shell");
return Shell.RegRead(MsgPlus.ScriptRegPath + Messenger.MyEmail + "\\" + key);
delete Shell;
}
I also tried this when reading:
code:
preferences.percentage = Boolean(ReadRegistry("\preferences\\percentage"));
and
code:
preferences.percentage = new Boolean(ReadRegistry("\preferences\\percentage"));
If anyone knows what I'm doing wrong, all help is appreciated.