SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 1 Vol 2

RESTORE VARIABLE

Name:
    RESTORE VARIABLE
Type:
    Support Command
Purpose:
    Restore a user specified list of variables and parameters that were saved to a file by the SAVE VARIABLE command.
Description:
    The primary purpose of this command is for use with general purpose macros. Specifically, macros can save the current values for certain variables, re-use those variables in the macro and then restore the original values to the variables.

    You can save variables and parameters. However, matrices and strings/functions are not currently supported.

    The SAVE VARIABLE command is used to save the variables to a file. The RESTORE VARIABLE command can then be used to restore the variables and parameters in this file.

Syntax:
    RESTORE VARIABLE <file-name>
    where <file-name> is the name of a file where the variables and parameters were previously saved.

    If no <file-name> is given, the file "dpsavf.tex" is used.

    No variable list is given as the variable and parameter names are contained in the file.

Examples:
    RESTORE VARIABLES
    RESTORE VARIABLES VARLIST.DAT
Note:
    The format of the save file is something like
            Y        VARIABLE
                     3
              0.1800000E+02
              0.3800000E+02
              0.1500000E+02
            AVAL     PARAMETER
              0.1000000E+01
        
    For each name, the first line prints the variable/parameter name and also prints the type (VARIABLE or PARAMETER). If the name is a variable, the next line specifies the number of elements in the variable. The contents of the variable are then printed one element per line. If the name is a parameter, then the value of the parameter is printed on the next line.

    Variables and parameters are printed one at a time.

    When the RESTORE VARIABLE command is given, Dataplot will go through the list of names. The name will be checked against the current Dataplot name table. If the name currently exists as a string or a function, the name will not be restored. If the name exists as a parameter or a variable, it will be overwritten by the values in the file. One complication is when the type in the current name table does not match the type in the save file. If the current name is being upgraded from a parameter to a variable, this should not cause any problems. However, if the current name is being modified from variable to a parameter, it is recommended that you delete the current variable before issuing the RESTORE VARIABLE command. If no match is found in the current name table, the variable or parameter will be added. Names that are in the current name table but not in the save file will not be changed.

Note:
    Dataplot has no restrictions on the file name other than it be a valid file name on the local operating system and that it contain a period "." in the file name itself or as a trailing character. Dataplot strips off trailing periods on those systems where it is appropriate to do so. On systems where trailing periods can be a valid file name (e.g., Unix), Dataplot opens the file with the trailing period.
Note:
    File names are case sensitive on Unix/Linux and MacOSX file systems. For these systems, Dataplot opens the file as given. All other currently supported systems are not case sensitive regarding file names.

    As a further caution for Unix hosts, certain expansion characters (specifically ~ to refer to your home directory) are interpreted by the shell and are not recognized by the Fortran compiler. These expansion characters are interpreted as literal characters and do not yield the intended file name.

Default:
    None
Synonyms:
    None
Related Commands:
    SAVE VARIABLE = Save variables and parameters to a file.
    SAVE MEMORY = Save all internal Dataplot settings to a file.
    RESTORE MEMORY = Restore all internal Dataplot settings from a previously saved file.
    RESET = Reset internal DATAPLOT settings to their default values.
Applications:
    Utility for Macros
Implementation Date:
    2020/12
Program:
     
    SKIP 25
    READ BERGER1.DAT Y X BATCH
    SAVE VARIABLES Y X BATCH
    .
    LET Y = NORMAL RANDOM NUMBERS FOR I =  1 1 100
    LET X = SEQUENCE 1 1 10
    LET BATCH = 1 FOR I = 1 1 10
    .
    RESTORE VARIABLES
    PRINT Y X BATCH
        

Privacy Policy/Security Notice
Disclaimer | FOIA

NIST is an agency of the U.S. Commerce Department.

Date created: 12/09/2020
Last updated: 12/09/2020

Please email comments on this WWW page to alan.heckert@nist.gov.