load file to listbox

By | 2002-06-01

2 simple code that save items to a file and the other that load items to the listbox from the file visit my homepage at http://www.cyberway.com.sg/~dyrws 4 more app

Original Author: Dua Yong Rew

Code

*** The Save Function ***
  Open App.Path & "" & "playlist.dyr" For Output As 1
    For x = 0 To List1.ListCount - 1
      List1.ListIndex = x
      Print #1, List1.Text
    Next
  Close 1
*** The Load Function ***
  Open App.Path & "" & "playlist.dyr" For Input As 1
    Do Until EOF(1)
      Line Input #1, st
      List1.AddItem st
    Loop
  Close 1

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.