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

STRING SPACE

Name:
    STRING SPACE (SET)
Type:
    Set Subcommand
Purpose:
    Specify how a "SP()" is interpreted in a string.
Description:
    By default, the command

      LET STRING S = SP()

    will create a string S with a single space character.

    However, if you do something like

      LET STRING S = SP()
      LET STRING T = ^S

    you will get an error message and the string T will not be created. This is due to the fact that the substitution (i.e., the "^") is performed before the command is interpreted. That is, the command that Dataplot tries to interpret is

      LET STRING T =

    However, if you enter the commands

      SET STRING SPACE IGNORE
      LET STRING S = SP()
      SET STRING SPACE EXPAND
      LET STRING T = ^S

    then Dataplot sees the command

      LET STRING T = SP()

    and it creates the string T with a single space character.

    Since in most cases you want the SP() to be converted to a single space, EXPAND is the default.

Syntax:
    SET STRING SPACE <EXPAND/IGNORE>

    Specifying EXPAND means that if SP() is encountered in a LET STRING command, it will be converted to a single space. Specifying IGNORE means that if SP() is encountered in a LET STRING command, it will left as SP().

    Any argument other than PROMPT or TERMINATE will be treated as equivalent to IGNORE (for example, SET FATAL ERROR DEFAULT).

Examples:
    SET STRING SPACE IGNORE
    SET STRING SPACE EXPAND
Default:
    EXPAND is the default.
Synonyms:
    OFF and NO will be interpreted as IGNORE. All other arguments will be interpreted as EXPAND.
Related Commands:
    LET STRING = Define a string.
    ^ = Substitute the value of a string or parameter.
Applications:
    String Manipulation
Implementation Date:
    2009/02
Program:
     
    . The following sequence of commands results in an error
    . for the string st2.
    .
    let string st1 = sp()
    let string st2 = ^st1
    .
    . The following successfully creates st2 as a string with
    . single blank character.
    .
    set string space ignore
    let string st1 = sp()
    set string space expand
    let string st2 = ^st1
        
    The following output is generated
          ****************************************************************
          **  . The following sequence of commands results in an error  **
          ****************************************************************
     
     
          *****************************
          **  . for the string st2.  **
          *****************************
     
     
          *********
          **  .  **
          *********
     
     
          *****************************
          **  let string st1 = sp()  **
          *****************************
     
     
    INPUT FUNCTION        = sp()
    OUTPUT FUNCTION       =
     
    THE NAME ST1      HAS JUST BEEN EQUIVALENCED
    TO THE FUNCTION      --
     
     
          ************************
          **  let string st2 =  **
          ************************
     
     
    ***** ERROR IN DPLETF--
          IMPROPER FORM FOR THE    LET FUNCTION   COMMAND.
          NOTHING FOUND TO THE RIGHT OF THE EQUAL SIGN
          THE ENTERED COMMAND LINE IS AS FOLLOWS--
          LET STRING ST2 =
     
    ***** ERROR CONDITION ENCOUNTERED AT MAIN 8112.
          THE FIRST 8 CHARACTERS OF THE FIRST WORD
          OF THE COMMAND ARE LET
          PLEASE REENTER COMMAND LINE.
     
          *********
          **  .  **
          *********
     
     
          *****************************************************************
          **  . The following successfully creates st2 as a string with  **
          *****************************************************************
     
     
          *********************************
          **  . single blank character.  **
          *********************************
     
     
          *********
          **  .  **
          *********
     
     
          *******************************
          **  set string space ignore  **
          *******************************
     
     
    THE FORTRAN COMMON CHARACTER VARIABLE STRISPAC HAS JUST BEEN SET TO IGNO
     
          *****************************
          **  let string st1 = sp()  **
          *****************************
     
     
    INPUT FUNCTION        = sp()
    OUTPUT FUNCTION       = sp()
     
    THE NAME ST1      HAS JUST BEEN EQUIVALENCED
    TO THE FUNCTION      -- sp()
     
     
          *******************************
          **  set string space expand  **
          *******************************
     
     
    THE FORTRAN COMMON CHARACTER VARIABLE STRISPAC HAS JUST BEEN SET TO EXPA
     
          *****************************
          **  let string st2 = sp()  **
          *****************************
     
     
    INPUT FUNCTION        = sp()
    OUTPUT FUNCTION       =
     
    THE NAME ST2      HAS JUST BEEN EQUIVALENCED
    TO THE FUNCTION      --
        

Privacy Policy/Security Notice
Disclaimer | FOIA

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

Date created: 02/10/2015
Last updated: 02/10/2015

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