setRegistry Dword -hex value?

SparkOut SparkOutYNY at gmail.com
Thu Aug 20 06:07:03 EDT 2009


Hi Matthias, 
You've been doing some things, among which is trying to represent the DWORD
value as a string to be written. It will need to be binary converted as
integers, so you will need to do a bit of converting to get the value stored
and retrieved:

put "HKEY_CURRENT_USER\Software\DameWare Development\NT Utilities\DNTU\DWRCC
Settings\Connect To Client\Port0" into tKey2
   put "17F2" into tHex
   --or put 6130 into tDecimal
   --you need to be working with the binary conversion
   --of the value represented either way
   
   put binaryEncode("I*",baseConvert(tHex,16,10)) into tBinary
   
   --or if you already have the decimal value, just use that directly
   --put binaryEncode("I*",tDecimal) into tBinary
   
   --set the registry key using the binary encoded value
   get setregistry(tKey2,tBinary,"dword")
   put it
   
   
   --To retrieve the value in the key, it will need decoding from binary:
   
   put queryRegistry(tKey2,tType) into tValue
   --tType is an optional placeholder variable name and 
   --the type of the key being queried will be returned
   --in that variable name. It's irrelevant in this specific
   --example as you already know it's a DWORD type
   
   get binaryDecode("I*",tValue,tDecimal)
   --tDecimal is a placeholder variable for the result, you don't "put
binaryDecode("I*",tValue) into tDecimal
   
   put baseConvert(tDecimal,10,16) into tHex
   --get the hex back if you need it

HTH

-- 
View this message in context: http://www.nabble.com/setRegistry-Dword--hex-value--tp25052932p25059307.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list