pb dropdownlistbox解决办法

pb dropdownlistbox
用additem函数增加的项
调用item[i]会出错
怎么解决?
------解决方案--------------------
i=?
报错的信息是什么?
------解决方案--------------------
你怎么定义数组的?

引用:
i = 1
数组越界

------解决方案--------------------
我就是搞不懂为什么提示越界错误!
你把你的代码贴多些出来看看!

引用:
服你了
dropdownlistbox的item不就是数组嘛

------解决方案--------------------
Controls 

ListBox and DropDownListBox controls

Syntax 

listboxname.AddItem ( item )

Argument Description
listboxname The name of the ListBox or DropDownListBox in which you want to add an item
item A string whose value is the text of the item you want to add
Return value 

Integer. Returns the position of the new item. If the list is sorted, the position returned is the position of the item after the list is sorted. Returns -1 if it fails. If any argument's value is null, AddItem returns null.


------解决方案--------------------
AddItem()
功 能在列表项的尾部增加一个新的列表项 该函数不改变下拉列表框的Item[ ]属性
语 法listboxname.AddItem ( item )
参 数listboxname 下拉列表框的名称
item String 类型要增加列表项的文本
返回值Integer 函数执行成功时返回新增加列表项的位置如果该控件设置为自动排序方
式那么返回的列表项位置是排序之后的位置函数执行失败时返回-1 如果任何
参数的值为NULL 则AddItem()函数返回NULL
用 法如果下拉列表框中已经包含了一些列表项那么AddItem()函数把新增加的列表项
放置在其它列表项的后面如果该控件设置为自动排序方式即该控件的Sorted
属性设置为TRUE 那么列表项插入之后PowerBuilder 自动重新排序列表项
下拉列表框中列表项的文本即显示在下拉列表框中的文字可以相同 下拉列表框
通过位置而不是列表项的文本来区分列表项

------解决方案--------------------
很简单的一个问题。
当你用additem()函数动态增加item项的时候,item[]数组是无用的。
只有在你在程序里写死的item项,item[]数组才可以用。
PB帮助里面有提到。你应该看看帮助。
------解决方案--------------------
用数据窗口代替最简单