What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » reading boolean from registry

reading boolean from registry
Author: Message:
Ezra
Veteran Member
*****

Avatar
Forgiveness is between them and God

Posts: 1960
Reputation: 31
37 / Male / Flag
Joined: Mar 2003
O.P. reading boolean from registry
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.




This post was edited on 07-21-2006 at 08:59 PM by Ezra.
[Image: 1-0.png]
             
07-21-2006 08:48 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
reading boolean from registry - by Ezra on 07-21-2006 at 08:48 PM
RE: reading boolean from registry - by deAd on 07-21-2006 at 09:20 PM
RE: reading boolean from registry - by TheGeek on 07-21-2006 at 09:22 PM
RE: reading boolean from registry - by Ezra on 07-21-2006 at 10:28 PM
RE: reading boolean from registry - by CookieRevised on 07-21-2006 at 10:31 PM
RE: reading boolean from registry - by Ezra on 07-22-2006 at 03:56 PM
RE: reading boolean from registry - by J-Thread on 07-22-2006 at 06:04 PM
RE: reading boolean from registry - by Ezra on 07-22-2006 at 06:08 PM
RE: reading boolean from registry - by J-Thread on 07-22-2006 at 07:19 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On