Search                        Top                                  Index
HELP FILE                                                A. Sloman Feb 1982

For information about FILES do TEACH * FILES.  More advanced information is
provided in the following HELP files: * DISCIN * DISCOUT * DEVICE
and in REF * SYSIO.

--- FILE MACRO -------------------------------------------------------------

    file <variable> in <filename>;

FILE is a library macro which can be used to store the value of a variable in
a file.

To make this available do
    lib file;
or
    uses file;


If you have a variable FOO say, whose value is a list, and you wish to save
the value so that the next time you log in you can carry on with the same
program, you can do something like

    file foo in foorecord.p;

You will later be able to type

    load foorecord.p;

and the value of FOO will be restored. This is often useful if your program
has been altering a database, and you wish to keep a record of the new
database. You can do:

    file database in mydata.p;

Please note, this command cannot be used inside a procedure at present. If
you wish a procedure to save the current value of database, do, inside the
procedure:

    popval([file database in mydata.p;])

In this case the semicolon is ESSENTIAL. If you are typing directly to POP11,
the semi-colon is optional.  See HELP * POPVAL

If a previous version of the file exists, it will be over-written by this
command. The file which is created can be edited like any other file. You
will then see that it contains a declaration of the variable (e.g. VARS FOO;)
and an assignment to it.

See also HELP * STOREDATA