yorick banner

Home

Manual

Packages

Global Index

Keywords

Quick Reference

Yorick Language Reference

Saving and Restoring Variables

save, f, var1, var2, ..., varN saves the varI in binary file f
restore, f, var1, var2, ..., varN restores the varIfrom f
save, f saves all array variables in binary file f
restore, f restores all variables from binary file f

Unlike f.varI = expr, the save function will create the variable varI in the file f if it does not already exist.

The restore function redefines the in-memory varI . If several binary files are open simultaneously, the f.varI syntax will be more useful for reading variables than the restore function.

Note that a single command can be used to create a binary file, save variables varI in it, and close the file:
 save, createb(filename), var1, var2, ..., varN
A similar construction using restore and openb is also useful.