End of list in ComboBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dfg

    End of list in ComboBox

    Hello again. Thanks for everyones help btw. Just one more question.

    I have a combo box with 10 items in it. I would like to write these
    items to a sequential file. I was thinking i could just loop through
    the items and write them to the file like so:

    Do While Not EOF(1)
    Input #1, cboVehicle.List
    Loop

    But I can't use EOF (of course) because it's not a file, it's a
    combobox. Is there some way to determine when I hit the the last item
    in the list, or when the last item has been written to the file?

    Thanks.

  • Larry Serflaten

    #2
    Re: End of list in ComboBox

    >[color=blue]
    > I have a combo box with 10 items in it. I would like to write these
    > items to a sequential file. I was thinking i could just loop through
    > the items and write them to the file like so:
    >
    > Do While Not EOF(1)
    > Input #1, cboVehicle.List
    > Loop
    >
    > But I can't use EOF (of course) because it's not a file, it's a
    > combobox. Is there some way to determine when I hit the the last item
    > in the list, or when the last item has been written to the file?[/color]


    If you're working with a list of known size, use For/Next. When
    you don't know how many iterations will be needed, then use Do/Loop

    For i = 0 to Combo1.ListCoun t - 1
    Print #1, Combo1.List(i)
    Next

    HTH
    LFS





    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

    Comment

    • edoepke

      #3
      Re: End of list in ComboBox


      "dfg" <dfg@dfg.net> wrote in message news:w%jtb.3933 15$pl3.20831@pd 7tw3no...[color=blue]
      > Hello again. Thanks for everyones help btw. Just one more question.
      >
      > I have a combo box with 10 items in it. I would like to write these
      > items to a sequential file. I was thinking i could just loop through
      > the items and write them to the file like so:
      >
      > Do While Not EOF(1)
      > Input #1, cboVehicle.List
      > Loop
      >
      > But I can't use EOF (of course) because it's not a file, it's a
      > combobox. Is there some way to determine when I hit the the last item
      > in the list, or when the last item has been written to the file?
      >
      > Thanks.
      >[/color]


      Comment

      Working...