next up previous contents
Next: Ini Object Up: Properties Previous: type   Contents

data

Description

Represents the data value.


Syntax

Regvalue.data


Remarks

When reads from the registry, FFish Script automatically converts the result for you. If the value type is REG_BINARY, REG_EXPAND_SZ, REG_SZ, REG_RESOURCE_LIST or REG_LINK, this property returns a String. If the value type is REG_DWORD or REG_DWORD_BIG_ENDIAN, this property returns an integer. And if the value is of type REG_MULTI_SZ, it returns an array of string.
When writes into the registry, this property accepts numbers, strings and arrays. If you want to write a DWORD value, store a number to this property. If you want to store a REG_SZ value, assign a string to this property. And If you want to write a value of type REG_MULTI_SZ, make an array and set it to this property.


Example

//Writes a DWORD value
rv = new RegValue;
rv.name = "number";
rv.type = 4;
rv.data = 1;
r = RegKey.create("HKCU\\Software\\Demo");
r.write(rv);

//Writes a String value
rv = new RegValue;
rv.name = "string";
rv.data = "Hello world";
r = RegKey.create("HKCU\\Software\\Demo");
r.write(rv);

//Writes a multi string value
a = ["data0", "data1", "data2"];
rv = new RegValue;
rv.name = "multi_string";
rv.data = a;
rv.type = 7;
r = RegKey.create("HKCU\\Software\\Demo");
r.write(rv);




Copyright ©2000-2010 Shanghai TopCMM Software Technologies. All Rights Reserved.