Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A Question on memory set aside for Zero
#11
I did change the Dim MyDate to Dim MyData and ran the code. You know I knew as soon as I wanted to use the data in the sequential file that I should be converting it to Random access but somewhere sometime ago I did successfully use Seek on a Sequential file. Either it was dumb luck or I had a way of recording the location as if it was a record. Thanks for the code, now if only my brain would get out of bed I might get some coding done today. Thanks again Steve
Reply
#12
As long as all the data is the same size, you can use SEEK with it.

01
11
31
47

^ All of those are going to be 4-bytes in length, in your file.  Two bytes for the data and two bytes for CRLF (on windows; only one byte for CRLF on linux/max).

But, if you have data like:

1
11
123
9
0
-321

^That data isn't going to be readable with SEEK.  Some is 1 byte.  Some is 4.  It's variable length data, and the only real way to read it is to read it sequentially.

It sounds like you got lucky once with data that was all the same size, like the first batch is above.  Unfortunately, it doesn't sound like the second batch of data you're using allows that.  It's more like the second set of examples I've posted above.  Your best bet is to just read it and convert it to a fixed-size data format.  Wink
Reply




Users browsing this thread: 4 Guest(s)