AddItems
Description
Adds
a list of new items to the list of choices created by a CHOICE_LIST
hook. You can use this method to add multiple items, instead of calling AddItem
multiple
times.
The pre-existing HookChoices object is
stored in a variable called choices
that is visible
only within a CHOICE_LIST hook. In the syntax section of this method, choices
is
a variable name that must be typed literally(for hooks, not
global scripts)
; it is not a placeholder for an arbitrary
name or expression. This is the only way to access a HookChoices object.
A CHOICE_LIST hook can call this method to build up a list of choices for the user. The object contains no items when you first access it. Order the items you list in the array in the order in which you want them to appear, because the list is not automatically sorted.
There is no RemoveItem method. Duplicate items are not automatically removed, but empty values are.
Syntax
VBScript
choices.AddItems
(items)
- Identifier
- Description
- choices
- A special HookChoices object.
- items
- A VARIANT which contains an array of Strings, each of which is a list item in the choice list.
- Return value
- None.
Example
VBScript
Dim platform(2) ' This sets up an array of three elements
platform(0) = "Professional"
platform(1) = "Professional SP1"
platform(2) = "Server"
choices.AddItems platform