Contents Previous Next Subchapters

Loading and Saving Work Space
Syntax load file name
save file name
See Also read , write , omrte , omvm , ompcode

Save Command
The save command saves the current O-Matrix program, constants, symbols and data values in the file named file name . The created file, file name is a binary, "pcode" file which will load significantly faster than source files. The use of pcode files also enables you to distribute applications without source code, protecting proprietary work.

This command is only available with the O-Matrix Development Kit license.

Load Command
The load command loads the O-Matrix program, constants, symbols and data values from the file named file name . This file must have been created using the save command. In addition, the same version of O-Matrix must be used when executing the save command.

Example
If at the command line enter
     clear
     function f(x) begin
          return x^2
     end
     y = seq(5)'
     save test.omx
O-Matrix will save your program and data in a binary file called test.omx in the current directory. If you exit O-Matrix, then restart and then enter:
     load test.omx
     print y
O-Matrix will respond
     [ 1 , 2 , 3 , 4 , 5 ]
If you continue by entering
     print f(y)
O-Matrix will respond
     [ 1 , 4 , 9 , 16 , 25 ]

Restrictions
The load and save commands cannot appear inside of a function.

Windows and Dialogs
When you execute the load command, all of the windows, dialogs, and toolbar are set to their initial state; i.e., the dialogs are dismissed, the default windows are visible and empty, and the toolbar is enabled.

Memory
If you save and then load your program, O-Matrix will return program and data memory that it is not currently using to the system. This may be useful if your data or program space is currently much smaller than it was previously during this O-Matrix session.

Reference
Note that when you execute the load command, no O-Matrix statements are executed. Only the program state and variable values are restored. Thus you can speed up program initialization by executing a save command at the end of the initialization and then just executing a load command to start the program next time.