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

SAVE VARIABLE

Name:
    SAVE VARIABLE
Type:
    Support Command
Purpose:
    Save a user specified list of variables and parameters to an external file.
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 RESTORE VARIABLE command is used to restore the variables saved by this command.

Syntax:
    SAVE VARIABLE <file-name> <list-variables>
    where <file-name> is the name of a file where the variables and parameters are saved;
    and <list-variables> is a list of parameters and variables.

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

    If no variables are specifed, then all currently defined variables and parameters will be saved.

Examples:
    SAVE VARIABLES
    SAVE VARIABLES VARLIST.DAT
    SAVE VARIABLES VARLIST.DAT Y X1 X2 X3 X4
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.

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:
    RESTORE VARIABLE = Restore variables and parameters saved with a SAVE VARIABLE command.
    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.