The toVBArray method first empties the g_dict object, then populates it with key/value pairs. The keys contain the numeric array subscript numbers. (The keys in a Dictionary object must be unique.) The values contain the elements from the JScript array. The toVBArray method uses the Items method to return the g_dict object's items as a VBArray object.
dictToJSArray. The dictToJSArray method provides a JScript script the ability to convert a Dictionary object into a JScript array. The dictToJSArray method is useful when you're using the component's EnumKey, EnumValues, or EnumValuesAndData method in a JScript script because these methods all return a reference to a Dictionary object.
The dictToJSArray method uses the syntax
dictToJSArray(Dictionary)
where Dictionary is a Dictionary object.
The dictToJSArray method works by calling the g_dict object's Keys method, which returns a VBArray object. Using the toArray method, dictToJSArray converts this object into a JScript array and creates a new Array object to contain that array. Using JScript's for...in statement, the dictToJSArray method iterates through the JScript array, populating it with the key/value pairs. Finally, dictToJSArray returns the resulting JScript array.
Accessing the Registry Made Simple
The Penton.RegObject object addresses the shortcomings inherent in the WMI registry methods and makes it both simple and elegant to read and make changes to the registry, no matter whether you prefer to use VBScript or JScript. Next month, I'll provide some sample VBScript and JScript code so you can get a better feel for how the object works and how to implement it in your own scripts.
End of Article
Prev. page
1
2
[3]
next page -->