Results 1 to 7 of 7

Thread: [Rslvd With "Option Strict Off"] Integer Array, FilePut, FileGet

Threaded View

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    [Rslvd With "Option Strict Off"] Integer Array, FilePut, FileGet

    I can't seem to find a way of writeing an integer array to a file, and reading it back.

    I thought I almost had it:

    VB Code:
    1. Dim MyTArr() As Integer
    2.         Dim MyBArr() As Integer
    3.         Dim MyF As Integer
    4.         ReDim MyTArr(10)
    5.         ReDim MyBArr(10)
    6.         For MyF = 99 To 109
    7.             MyTArr(MyF - 99) = MyF
    8.         Next
    9.         'Place Integer Array into file
    10.         MyF = FreeFile()
    11.         FileOpen(MyF, "C:\test.tst", OpenMode.Binary)
    12.         FilePut(MyF, MyTArr)
    13.         FileClose(MyF)
    14.         'Read Data in file into another integer array
    15.         MyF = FreeFile()
    16.         FileOpen(MyF, "C:\test.tst", OpenMode.Binary)
    17.         FileGet(MyF, MyBArr)
    18.         FileClose(MyF)
    19.         'AGGGHHH!!! Theres that Darned Blue Snake Of Death!!!!

    But the dreaded Blue Snake of Death appears under my FileGet!

    How Can an Integer Array be put into a file, then later retrieved?

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