write



principle
write
alias         ascii
compile
func         format
history
type
unformated
var
See also

principle

The command write alows save anyflo objects on the disk.
The file name search is made:
       1) in the current folder (from which is launched anyflo, typically distribution).
       2) in the datas base folder (typically ima).
       3) in the environment folder (typically env).
By default a file with same name is erased. To protect write file do: no write.

write

write(expr) name("foo")

       Saves the evaluation of expr in file foo.
write(expr) name("foo") add
        Adds expr after the file foo.
Notes:
File search takes place in order:
       First in the datas base folder (directory "ima")
       Then in the environment folder (directory "env")
       Finaly in the folder containing the executable of anyflo.
See alsowrite format.

write alias

write alias("nnn")

        Saves the alias in the file nnn.ali

write ascii

write(expr) ascii(n)name("foo")

        Saves expr (floats) in the ascii file foo by lines of n floats (n=1 default).
        read("foo") returns the string.

write compile

write compile("nnn")

        Saves all functions in the file nnn.func and their compilation in the filz nnn.comp

write func

write func "fff"

        Saves all the functions in the file fff.func

write func "ff1,ff2"

        Saves the function ff1 in the file ff2.func

write format

write(x)format("char")name("nnn")

        Writes expression x as a a characteres string in file nnn.

write(x)format("short")name("nnn")

        Writes expression x as shorts in file nnn.

write(x)format("long")name("nnn")

        Writes expression x as longs in file nnn.

write(x)format("float")name("nnn")

        Writes expression x as floats in file nnn.

write(x)format("double")name("nnn")

        Writes expression x as doubles in file nnn.
It will be necessary to kno the type of such files to read them by read name("name")format("fff").

write(x)format("anyflo") name("nnn")

        Writes expression x as anyflo format in file nnn:
[dim,type,np,dimp] [datas]
       dim=size (32 bits).
       type=datas type:
     type=A_CHAR: datas=characteres
     type=A_SHORT: datas=shorts
     type=A_LONG: datas=longs
     type=A_FLOAT: datas=floats
     type=A_HYBRIDE: Datas=blocks list of previous type.
       np=number of vectors
       dimp=size of the vectots (0 for an HYBRIDE block).
[datas] = datas block or such blocks list for na HYBRIDE type.

write history

write history("nnn")

        Saves the memorized commands by history in the file nnn.his

write type

write type("nnn")

        Saves the types in the file nnn.type

unformated write

write(x)name("nnn")

        The datas type of expression x is automatically used to write the file nnn.
Such a file can simply be read by: w=read("nnn");
Examples:
write("abc")name("nnn");$read(("nnn");
        prints abc
write(1,2,3)name("nnn");$read(("nnn");
        prints 1,2,3

write var

write var("nnn")

        Saves all the external variables in the file nnn.var

write var("x") name( "nnn")

        Saves the variable x in the file nnn.var

See also:

no write
yes write