Page 1 of 1 1
Topic Options
#182352 - 2007-11-08 02:29 PM WriteValue truncates REG_DWORD
barrycaruth Offline
Fresh Scripter

Registered: 2005-05-04
Posts: 7
The code:

 Code:
$result = WriteValue ("HKEY_CURRENT_USER\Software\Blah","TestValue","4294967295","REG_DWORD")

creates a registry value of 0x7fffffff rather than 0xffffffff as expected.

It looks like writevalue doesn't support double integers.

Is that correct?

Top
#182357 - 2007-11-08 04:27 PM Re: WriteValue truncates REG_DWORD [Re: barrycaruth]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
you're passing a string - remove the quotes from your value and try again..

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182362 - 2007-11-08 05:47 PM Re: WriteValue truncates REG_DWORD [Re: Glenn Barnas]
barrycaruth Offline
Fresh Scripter

Registered: 2005-05-04
Posts: 7
Same result. 2147483647 or 0x7fffffff.

Edited by barrycaruth (2007-11-08 05:48 PM)

Top
#182363 - 2007-11-08 06:40 PM Re: WriteValue truncates REG_DWORD [Re: barrycaruth]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
OK - try CDbl(value) or adding a ".0" to the end, which Kix will recognize as a double value. (ie: 13238490284.0, not 13238490284)

G-
_________________________
Actually I am a Rocket Scientist! \:D

Top
#182369 - 2007-11-08 11:20 PM Re: WriteValue truncates REG_DWORD [Re: Glenn Barnas]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
The code is OK. No problem wrapping the value in quotes.
Add @KIX to the script
If the version is 4.60, the error occurs.
I think this thread should be moved to Beta.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 998 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.055 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org