Results 1 to 6 of 6

Thread: List1.AddItem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2008
    Posts
    130

    List1.AddItem

    Hi!

    I need when I open a APP, it open a .txt, get all LINES and each line of .txt is 1 ITEM in the List1.

    it's possible? thanks!

  2. #2
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: List1.AddItem

    Dim sText as string


    Open "c:\example.txt" for input as #1
    do
    lineinput #1, sText
    list1.additem sText
    loop while not eof(#1)

  3. #3
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157

    Re: List1.AddItem

    Code:
        Dim intFile  As Integer
        intFile = FreeFile
        Open App.Path & "\Test.txt" For Input As #intFile
        'Do While Not EOF(intIFF)
        Do Until EOF(intFile)
            Line Input #intFile, strInputData
            List1.additem strInputData
        Loop
        Close #intFile
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  4. #4
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157

    Re: List1.AddItem

    Sorry PeteLeeb.
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: List1.AddItem

    LOL.. no worries Liquid Metal..

    We just provided twice as much help..

  6. #6
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: List1.AddItem

    no probs as you both posted at the same time without your knowledge...it happens at times...;-)
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width