XLISP restore

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference

# restore

Type: | - | function (subr)
Source: | - | xldmem.c, xlimage.c

## Syntax

(restore file)
  file - a string or symbol for the name of the file
  returns - NIL on failure, otherwise never returns

## Description

The 'restore' function restores the previously saved XLISP workspace [system state] from the specified file. The 'file' may be a string or a symbol. If the 'file' does not include a '.wks' suffix, it will be extended to be called 'file.wks'. If successful, 'restore' will print a message saying:

    [ returning to the top level ]

and will not return any value. If 'restore' fails, it will return NIL. There can be several saved workspaces. These workspaces can be restored as often as desired.

## Examples

    (setq myvar 5)       ; set MYVAR to value 5
    myvar                ; returns 5

    (save 'farp)         ; save workspace in FARP.wks

    (setq myvar "garp")  ; change MYVAR to "garp"
    myvar                ; returns "garp"

    (restore 'farp)      ; restore workspace
    myvar                ; returns 5

File names: In the PC and DOS world, all file names and extensions ["foo.bat"] are automatically made uppercase. In using XLISP, this means you don't have to worry about whether the name is "foo.bat", "FOO.BAT" or even "FoO.bAt", they will all work. However, in other file systems [UNIX in particular], uppercase and lowercase do make a difference:

This will create a file named FOO-FILE in UNIX, because XLISP uppercases its symbols:

    (open 'foo-file :direction :output)

This will create a file named 'foo-file' because UNIX doesn't uppercase its file names:

    (open "foo-file" :direction :output)

So, if you are having trouble with opening and accessing files, check to make sure the file name is in the proper case.

See the restore function in the XLISP 2.0 manual.

Back to Top

Nyquist / XLISP 2.0 - Contents | Tutorials | Examples | Reference