From: Tech@SoftByteLabs.com
Subject: Re: Need help with binary file question...
On 22 Mar 1998 06:52:05 GMT, pwrbasc@aol.com (PWRBASC) wrote:
>I am new to binary files. I am trying to read a file which is over 15 meg in
>size. Each record is 404 bytes long. When I read 82 records into the file, I
>get an error #15 (string length too long) using this command "GET$ 1,
Position,
>A$"
>When A$ exceeds the 32750 limit, then the error pops up. Is there some way
o
>reset A$ back to 0 and read another 32750 bytes into file from the point
where
>the first seek ended.
>
>By the way, I am using PB3.5
>
>Any help is greatly appreciated!
>Gary Stout pwrbasc@aol.com
If each records are 404 bytes, all you have to do is open the file
in RANDOM mode with the record length of 404, example...
OPEN "OPEN.DTA" FOR RANDOM AS #1 LEN = 404
you can then read all the records this way...
FOR I% = 1 TO LOF(1)
GET 1, I%, Char$
NEXT I%
or read any one record this way...
GET 1, , Char$
and you can update any single record this way...
PUT 1, , Char$
But if you prefer to use binary, make sure to set A$ to the proper
length before calling GET #1, , A$ like this...
A$ = STRING$(32750, " ") which will file A$ with 32750 spaces.
Michael
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|