NumericValues Property

This property affects the way your scripts refer to selected items in select lists, multi-select lists, select menus, checkbox groups, and radio button groups. If this property is False (the default), then selected items in these controls are referred to by their captions or text values. If this property is True, then selected items these controls are referred to by positional index.

object.NumericValues = new_state
existing_state
= object.NumericValues

Arguments

object

Required.  A variable containing a dialog object created by calling CreateObject or new ActiveXControl.

new_state

Required. True if selected items are referred to by index; False if they are referred to by caption.

existing_state

Required. True if selected items are referred to by index; False if they are referred to by caption.

Remarks
You may want to refer to items by index when some captions are duplicated or are very long or hard to type.

Example

Sub main
  ' Create the dialog box
  Set Dialog = CreateObject("TPFSoftware.ScriptDialog")


 ' Refer to list items by positional index rather than caption  Dialog.NumericValues = True
 ' Specify that item 1 will be selected by default  Dialog.AddSelectList "Nonsense", "Nonsense:", _    Array("fee", "fi", "fo"), 1
 ' Specify that items 1 and 2 will be selected by default
  Dialog.AddMultiSelectList "Nonsense2", "Nonsense2:", _    Array("fee", "fi", "fo"), Array(1,2)
 ' Display the dialog box
  Set Result = Dialog.Execute
End Sub