FREAD
 
Syntax


SUB FREAD ( FlashAddr, Destination, size

Destination arrayname | stringname 

size in bytes

FlashAddr must be word alligned (on a 4 byte address)

Description -- added version 7.13


The built-in subroutine FREAD copies data stored in the Flash memory to the Destination array, for size bytes.  When a string is used, it is treated like a byte array, not a 0 terminated string

You can also directly access the Flash with pointers.  To read a word in Flash, *FlashAddr will return that value

Example

'  simple example of write and read
DIM A(511) as string
DIM B(511) as string
 '...

WRITE (&H6000, A, 512)   ' this will erase the &H6000 sector, as its the first encountered
WRITE (&H6200, A, 512)   ' no erasure is required, as it was erased in the last call

FREAD (&H6200, B, 512)
 '...

WRITE (&H6000, A, 0)       ' this forces an erase of sector &H6000, needed as it was the last sector erased
WRITE (&H6000, A, 512)   

 '...

WRITE (&H6000, A, 512)    ' as the same block is being written it will automatically be erased
WRITE (&H6000, A, 512)


Differences from other BASICs

 

See also