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

CHECK TYPES

Name:
    CHECK TYPES (LET)
Type:
    Let Subcommand
Purpose:
    Given a list of names, check whether the types of all listed names are the same.
Description:
    Sometimes when writing general purpose macros it may be useful to know if certain names have been defined, and if so, what type they have.
Syntax 1:
    LET <iflag> = CHECK TYPES <type> <name1> <name2> ... <namek>
    where <type> is one of VARIABLE, STRING, PARAMETER, or MATRIX;
                <name1> <name2> ... <namek> is a list of 1 to k names;
    and     <iflag> is a parameter where the status is saved.

    The <type> argument specifies what type will be checked. If all names are of the specified type, <iflag> will be set to 1. Otherwise <iflag> will be set to 0.

Syntax 2:
    LET <iflag> = CHECK TYPES <name1> <name2> ... <namek>
    where <name1> <name2> ... <namek> is a list of 1 to k names;
    and     <iflag> is a parameter where the status is saved.

    With this syntax, the type of the first name listed will be determined and all subsequent names will be checked against this type.

    If all names are of the same type, <iflag> will be set to 1. Otherwise <iflag> will be set to 0.

Examples:
    LET IFLAG = CHECK TYPES VARIABLE Y X
    LET IFLAG = CHECK TYPES STRING STIN STOUD
    LET IFLAG = CHECK TYPES Y X
Note:
    The CALL EXIT and CALL EXIT ALL commands were added to allow you to exit a macro. The status flag from the CHECK TYPES command can be used to determine whether you want to exit from a macro or continue.
Default:
    None
Synonyms:
    None
Related Commands:
    CHECK NAMES = Check the types for a list of names.
    CHECK EQUAL LENGTH = Check whether a list of names have been previously defined.
    TYPE = Return the type of a previously defined variable.
Applications:
    Data Management
Implementation Date:
    2015/06
Program:
     
    skip 25
    read berger1.dat y x bat
    let iflag = check types y x bat
        
    The following output is generated
     
    THE STATUS FLAG FOR CHECK TYPE =        1
        

Privacy Policy/Security Notice
Disclaimer | FOIA

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

Date created: 06/30/2015
Last updated: 06/30/2015

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