Page 1 of 1

FREAD

Posted: Tue Dec 04, 2012 2:00 am
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.

Re: FREAD

Posted: Tue Dec 04, 2012 2:00 am
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)

Re: FREAD

Posted: Tue Dec 04, 2012 2:01 am
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)
>