Announcement

Collapse
No announcement yet.

saving historical data to a file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • saving historical data to a file

    Hi,

    I use one of the projects from the file sharing site, it is called Desktop VB Sample. It works. However, I am trying to add a statement to save the historical data to a file.

    I added the following statement in the getSym subroutine:

    FileNum = FreeFile ' Get a free file number
    Open "C:\MyDocuments\GILD_2006.txt" For Output As FileNum
    Print #FileNum, List1.List(1)
    Close FileNum

    The problem is it does not print the list contents (in this case, the first element of the ListBox List1). When I set a breakpoint at FileNum and try to examine List1, it does not display anything either. When I continue execution after the breakpoint, it does not display anything in the form frmMain! Yet, when I do not interrupt execution, it does display the data in the frmMain.

    Please, help.

    PS I am using VB 6, for which List1.List should be the right expression to access the members of the List, but correct me if I am wrong.

  • #2
    Hi magictrader,

    It looks like you are not instantiating the FileSystemObject. Click here for a good overview on using this functionality.

    Comment

    Working...
    X