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 2 Vol 1

TYPE

Name:
    TYPE
Type:
    Let Subcommand
Purpose:
    Return the type of a previously defined variable, parameter, string or matrix.
Description:
    Dataplot maintains an internal name table for variables, parameters, strings, and matrices. It may occassionally be useful to determine the type of a name in this table.

    This command will return a string with one of the following values:

      NONE The name was not found
      VARIABLE The name was found as a variable
      PARAMETER The name was found as a parameter
      STRING The name was found as a string or function
      MATRIX The name was found as a matrix

    Dataplot names are currently limited to a maximum of eight characters and should consist of alphabetic or numeric characters. Names should not include spaces or special characters.

    The TYPE command is most commonly used in general purpose macros to test if input variables, parameters, and strings are of the right type.

Syntax:
    LET <sout> = TYPE <string>
    where <string> is literal text that specifies the name to search for;
    and <sout> is a string that specifies the type for the given name.
Examples:
    LET SY = TYPE Y
Note:
    Character variables are stored in the "dpchzf.dat" file and are not stored in the internal Dataplot name table. The TYPE command does not search for names in "dpchzf.dat".
Note:
    Strings in Dataplot maintain their case. Be aware that the returned type is given in upper case. So when using the type string with the IF command, be sure to specify the value as upper case. That is, use

      if sy = VARIABLE

    rather than

      if sy = variable
Default:
    None
Synonyms:
    None
Related Commands:
    IF EXIST = Determine whether a parameter or a string is currently defined.
    UPPER CASE = Convert a string to upper case.
    LOWER CASE = Convert a string to lower case.
    LET FUNCTION = Defines a function.
    LET STRING = Defines a string.
    READ STRING = Reads a string from a file.
    SUBTRING = Extract a substring from an existing string.
    STRING INDEX = Extract the start/stop positions of a substring within a string.
    STRING CONCATENATE = Concatenate one or more previously defined strings.
    STRING EDIT = Edit a string.
    STRING REPLACE = Insert the contents of one string into another string at a specified position.
    STRING MERGE = Insert a string into another string without overwrite.
    STRING LENGTH = Return the length of a string.
    CHARACTER = Convert numeric values to strings based on the ASCII collating sequence.
    ICHAR = Convert a string to numeric values based on the ASCII collating sequence.
    GROUP LABEL = Define the text for group labels.
Applications:
    Data Management
Implementation Date:
    2014/12
Program:
    SKIP 25
    READ BERGER1.DAT Y X BAT
    LET STRING STITLE BERGER Data
    READ MATRIX M
    1 2 3
    4 5 6
    END OF DATA
    LET A = 2
    .
    LET SY = TYPE Y
    LET SX = TYPE X
    LET SZ = TYPE Z
    LET SA = TYPE A
    LET SM = TYPE M
    LET SS = TYPE STITLE
    PRINT SY SX SZ SA SM SS
    
    The following output is generated
     FUNCTIONS--
    
         SY      --VARIABLE
         SX      --VARIABLE
         SZ      --NONE
         SA      --PARAMETER
         SM      --MATRIX
         SS      --NONE
    
    .
    IF SY = VARIABLE
       IF SX = VARIABLE
          FIT Y X
       END OF IF
    END OF IF
    .
    IF SA = PARAMETER
       PRINT A
    END OF IF
        

Privacy Policy/Security Notice
Disclaimer | FOIA

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

Date created: 12/30/2014
Last updated: 12/30/2014

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