Storing and recalling variables and their values

### 4.5.4 Storing and recalling variables and their values

You can store variables and their values for later use in a file of your choosing with the archive function. This function takes two arguments, a filename to store the variables in and a variable or list of variables.

If you have given the variable a the value 2 and the variable bee the value "letter" (a string), then entering

> archive("foo",[a,bee])

will create a file named “foo” which contains the values 2 and "letter" in a format meant to be efficiently read by Xcas.

You can recall the values stored by archive with the unarchive command, which takes a file name as argument. If the file “foo” is as above, then

> unarchive("foo")

will result in

> [2, letter]

If you want to reassign these values to a and bee, you can enter

> [a,bee] := unarchive("foo")