Um Seth,

Make yourself an extends method that extends the listbox and does this for you, or I can send you one.

Sub AddLine Extends list as Listbox, ParamArray cells as variant

  dim v as variant
  dim currColumn as integer

  list.addrow ""

  for each v in cells
    list.cell(list.lastindex,currColumn) = v.stringValue
    currColumn = currColumn + 1
    if currColumn = list.ColumnCount then exit
  next

End Sub


Now you can say

ListBox.AddLine (1,2,3,4,5,6,7,8)
ListBox.AddLine ("one",2,3,4,"five",6,7,"eight")

or pass any value that can be translated into a string value into the AddLine arguement.

Cheers,
Tom


On 28/11/2006, at 5:24 AM, Seth Willits wrote:

http://www.realsoftware.com/feedback/viewreport.php?reportid=dqbmbnpj


Evaluation - REAL Software on 2006-11-27:
"listbox.cell(row,-1) does this"



You're kidding.


It's out of the question to make an AddRow method that accepts a variable number of arguments or an array? It's like 10 lines of code! Actually, not "like," it is.

Here let me help you out. This one's on the house, since I know it's pretty difficult to do:


Sub AddRow(Extends List as Listbox, ParamArray Cells as String)
  dim i as integer
  List.AddRow ""
  for i = UBound(Cells) DownTo 0
    List.Cell(List.LastIndex, i) = Cells(i)
  next
End Sub


Sub AddRow(Extends List as Listbox, Cells() as String)
  dim i as integer
  List.AddRow ""
  for i = UBound(Cells) DownTo 0
    List.Cell(List.LastIndex, i) = Cells(i)
  next
End Sub



Ta da! Yay! Convenience for all of us with two minutes of programming!



--
Seth Willits



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to