| |
Options Object
Contains:
Functions:
- Count (without parameters) - returns number of parameters in options.
- Get (name, value) - returns the parameter with name, which was saved previously. If there is no such parameter, it returns value. If you omit value, it returns Unassigned.
Example:
fp = IQ.Options.Get('FirstParam', 0);
Set (name , value) - sets parameter value. Previous value of the parameter with the same name will be lost. Value can be one of the following types - VT_EMPTY, VT_NULL, VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BSTR, VT_BOOL, VT_I1, VT_UI1, VT_UI2, VT_UI4. If you set the parameter to VT_EMPTY or VT_NULL, the parameter gets removed.
Example:
date = new Date();
IQ.Options.Set('last', date.getVarDate());
//save the date of the last change in the options
Save (without parameters) - saves options to disk. They will be also saved automatically when plugin finishes.
- Exists (name) - returns true if the parameter exists.
- Delete (name) - removes the parameter.
- GetList (name) - creates new list of parameters. It contains all functions listed above, except Save. If there is the list with the name already, it will be returned.
Example:
IQ.Options.GetList('URLs').GetList('www.metaproducts.com').Set('Note', 'Inquiry home')
//save a note related to the site
GetOrderedList (name) - creates new ordered list of parameters. It keeps the order of parameters, unlike GetList.
- GetName (index) - returns name of the parameter by index. It should be between 0 and Count() - 1.
Example:
for (i = 0; i < IQ.Options.Count(); i ++) {
window.alert(IQ.Options.GetName(i));
}
//show all parameter names in the options
GetByIndex (index) - returns parameter value by its index, which is between 0 and Count() - 1.
- SetByIndex (index, value) - sets parameter value by its index, which is between 0 and Count() - 1.
|
|
|