As you found out, nope you can't because the scripting engine doesn't support such calls (same with subclassing).
You could indeed write a DLL for that though. Although for this particular script I think it is not worth the hassle.
quote:
Originally posted by Domsy
A little modification I had to make. It didn't seem to like the "new Boolean()" thing, and I had to typecast the join result as a Number. Ended up with:
code:
bTabsEnabled = (Boolean)((Number)(reg.toArray().join('')));
...
Yeah, my 'trick' always returned
true, because apparently no matter what string you got, it always is converted to
true as a boolean. I didn't tested it with a binary value of 0x0, sorry about that....
(seems strange that a string of "0" would result in
true though - coming from VB point of view which does this automatic typecasting a lot better in this case
)
So, all you indeed needed todo was to first convert that string into a number:
bTabsEnabled = new Boolean(
(Number)(reg.toArray().join('')));
btw, this is the same (and shorter) and would work as expected too (as long as the binary value consists of 4 bytes):
bTabsEnabled = reg.toArray().join('') != '0000'