Blank Item Appears in Dialog ListBox or ComboBoxLast reviewed: July 30, 1997Article ID: Q101552 |
The information in this article applies to:
SUMMARYA Microsoft WordBasic ListBox or ComboBox control may contain a blank selection if the array variable assignment does not begin at 0 (zero) or if the array variable is dimensioned with more elements than needed.
MORE INFORMATIONAn array variable gives a single name to a group of related values and organizes them in a list or table.
Dim ArrayVariableName(LastElementNumber)The first element of a WordBasic array is always numbered 0 (zero). This means that the number of the last element is one less than the number of elements. For example:
Dim Months$(11) 'Define an array with 12 elementsBefore you display a dialog box containing a list or combo box, you must define an array and fill it with the items to be listed. For example:
Sub Main Dim FourWinds$(3) 'Define an array with 4 elements FourWinds$(0) = "East" FourWinds$(1) = "West" FourWinds$(2) = "North" FourWinds$(3) = "South" Begin Dialog UserDialog 320, 144, "Microsoft Word" OKButton 207, 92, 88, 21 CancelButton 207, 116, 88, 21 ListBox 21, 9, 169, 96, FourWinds$(), .Listbox1 End Dialog Dim dlg As UserDialog n = Dialog(dlg) End SubIf a value is not assigned to the first array element, FourWinds$(0), a blank selection will appear at the top of the list box. If a blank selection appears at the bottom of the list box, the number of array elements is NOT one less than the total number of elements.
Dim FourWinds$(3) 'Define an array with 4 elements REFERENCES"Using WordBasic," by WexTech Systems and Microsoft, page 80 Kbcategory: kbusage kbmacro KBSubcategory: |
Additional query words: 6.0 2.0 2.0a 2.0a-CD 2.0b 2.0c word6
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |