Shoutbox

[?] Boolean values - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] Boolean values (/showthread.php?tid=81982)

[?] Boolean values by Spunky on 02-28-2008 at 01:02 PM

Another n00b question.

code:
    show_in_psm = new Boolean(get("show_in_psm")*1);


Should return a boolean value that equals true right? Well, instead I get an object. Whats the deal-i-o? :p
RE: [?] Boolean values by TheBlasphemer on 02-28-2008 at 01:04 PM

show_in_psm = (get("show_in_psm")*1)>0;
would probably work :)


RE: [?] Boolean values by Spunky on 02-28-2008 at 01:07 PM

Thanks. Had to use *-1 though because it's a negative value in the registry :p

EDIT: But still, why was I getting an object?


RE: [?] Boolean values by -dt- on 02-28-2008 at 01:30 PM

quote:
Originally posted by SpunkyLoveMuff
Thanks. Had to use *-1 though because it's a negative value in the registry :p

EDIT: But still, why was I getting an object?
because its a wrapper class for a primitive type to get the primitive type use the valueOf method

code:
var x = new Boolean(1);
var bool = x.valueOf();