APPLICATIONS MAKER - HELP FOR FILE ITEMS

The  FILE  ITEMS execute operations relevant to the  manipulation  of
datafiles.  They are of seven types:  GET RECORD, WRITE RECORD,  NEW,
RELATIONAL WRITE, LOAD MARKER and SHOW.

GET RECORD ITEMS:  With the GET RECORDs the next available record  in
the  targeted file will be read into the file's buffer.  The data  it
contains  will  then  be available for use.  If you  have  loaded  no
MARKER  FILE these items will read all the records in the  file.   If
you have used the LOAD MARKER ITEM (below) these items will read  the
records in the MARKER FILE, in whatever order they're in.

The  GET  RECORD  ITEMS take a label as an argument.   When  all  the
records  have been processed (end of file or marker) the  GET  RECORD
ITEM will do a forward goto, branching to that label.

WRITE RECORD ITEMS:  With the WRITE RECORDs the data in the buffer of
the targeted file will be written to disk into the record from  which
it  came.

These  items  differ  from the RELATIONAL WRITES in  that  the  write
happens  whenever  the item is encountered and an  entire  record  is
written  instead of a single field.

The  use  of  the  WRITE  RECORD items  can  cause  trouble  if  your
application  terminates prematurely due to an error.  Your  file  has
been  updated  and  the rest of your  application,  after  the  error
occurred,  did not happen.  So, place WRITE RECORD items as  near  as
possible  to  the end of your application, after any  possibility  of
aborting the application.

NEW  ITEMS:  With the NEW items a new record in the targeted file  is
created.   Your  user will need to select, or allow  the  program  to
select, a record number for the new record.

The NEW item MUST be used in applications that write new records into
datafiles.   Failure to do so will cause the first or current  record
in the file to be over-written when the write is executed.

When  NEW  is used the first available hole in the  file  (caused  by
record  deletion) or new disk space for the record is read  into  the
file's  buffer and any data it may contain is replaced by  spaces  or
zero.  Thusly, a NEW RECORD is created.

So,  use  NEW items at the top of your screen, or at the top  of  the
segment  of your "program" that creates a new record.  The  NEW  item
must  be  executed  before any of the fields in the  new  record  are
filled.  Using NEW after some of the fields are filled will WIPE THEM
OUT.  Use a WRITE RECORD item when you have placed the necessary data
into the record, to record it to disk.

RELATIONAL  WRITE ITEMS:  With the RELATIONAL WRITEs  the  relational
writes  stored in memory for the targeted file are written  to  disk.

These  relational  writes  are  created when  the  WRITE  TO  ANOTHER
DATAFILE  option within data items is used.  Unlike the WRITE  RECORD
item, these items will not be executed until the RELATIONAL WRITE  is
encountered, presumably as the last step in your process, and only  a
single field is written as opposed to an entire record.  So, if  your
application ends with an error, nothing is changed.

If you update file five, field seven, then use that file/field  again
before you execute the RELATIONAL WRITE the new value will be used as
the list of relational writes is searched as data is read from disk.

Like  the  DO items the RELATIONAL WRITEs use memory to  store  their
file,  field,  new  value and update mode.  And  they  could  exhaust
available memory if not properly managed.  So, if your application is
cyclic  and  updates  files  via  these  items  you  should  place  a
RELATIONAL WRITE item for each file updated near the end of the cycle
to  conserve memory.  If the application bombs these writes will  not
be executed, and you're in trouble again.

RESET FILE ITEMS:  With the RESET FILEs the target file will be reset
to  the first record.  If you have used the LOAD MARKER FILE item  to
load  a marker for the file the marker file will be closed,  and  you
will  be able to load another marker or process all records.   It  is
not necessary to use this item just to close a marker.

LOAD  MARKER ITEMS:  With the LOAD MARKERs a MARKER FILE  written  by
the BASE program in the targeted file is loaded.  These MARKER  FILES
give  you the ability to process a pre-defined group of records in  a
pre-defined  order.   After executing a LOAD MARKER  the  GET  RECORD
items will fetch the next record from the marker instead of the file.

When  initializing  a LOAD MARKER item you may select a  MARKER  FILE
from  the menu of the markers present.  You may also press escape  to
bypass  file selection.  You will then have the option to  allow  the
user of your application to select the a marker from that same  menu.
This  is  handy  to do a report or operation on a  group  of  records
selected at runtime.

SHOW  ITEMS:  With the SHOW items the currently loaded record in  the
targeted file is displayed.  You select the file from the files menu,
and  you  have the option to allow your user to edit the  record  and
write it back to disk, or to display it read-only.