FREAD

Questions about the BASICtools and MakeItC
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

FREAD

Post by YahooArchive »

Hey, I am having a problem with FREAD. The WRITE function works
perfectly, however, the FREAD function seems to do absolutely nothing.
Here is the sample code that I am trying:

DIM A(512)
DIM B(512)

A(512)=9

WRITE ($6000, A, 512)
FREAD ($6000, B, 512)

PRINT A(512)
PRINT B(512)


This always prints B(512) as 0 or whatever value I declare it to be.
Am I doing something obviously wrong? There wasn't much documentation
on FREAD in the manual.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: FREAD

Post by YahooArchive »

> PRINT A(512)
> PRINT B(512)

The size of FREAD, FWRITE is in bytes

You declared the array as integers, and arrays start at 0, so you never
wrote A(512) or read B(512). I'm sure B(0) = A(0) ... A(127) = B(127)

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: FREAD

Post by YahooArchive »

thank you so much. i knew it was something obvious that i was being
completely ignorant to.


--- In ARMexpress@yahoogroups.com, "basicnode" <bruce@...> wrote:
>
>
> > PRINT A(512)
> > PRINT B(512)
>
> The size of FREAD, FWRITE is in bytes
>
> You declared the array as integers, and arrays start at 0, so you never
> wrote A(512) or read B(512). I'm sure B(0) = A(0) ... A(127) = B(127)
>

Post Reply