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

STRING CONCATENATE

Name:
    STRING CONCATENATE
Type:
    Let Subcommand
Purpose:
    Concatenate one or more strings.
Description:
    This command allows you to concatenate strings. Although this can also be done using the "^" and "&" characters, using the STRING CONCATENATE command may result in Dataplot code that is somewhat easier to use and read (particularly when many strings are being concatenated).
Syntax:
    LET <sout> = STRING CONCATENATE <s1> ... <sk>
    where <sout> is the name of the resulting string;
    and <s1> ... <sk> is a list of one or more previously defined strings.
Examples:
    LET STRING S1 = file
    LET STRING S2 = 99
    LET STRING S3 = .dat
    LET SOUT = STRING CONCATENATE S1 S2 S3
Note:
    The name of the new string can be the same as one of the previously defined strings. For example,

      LET FNAME = FILE
      LET SINDEX = ^K
      LET SEXT = .DAT
      LET FNAME = STRING CONCATENATE FNAME SINDEX SEXT
Note:
    All strings on the right hand side of the equal sign must be previously existing strings. That is, expressions are not allowed. For example, instead of

      LET FNAME = STRING CONCATENATE FNAME ".txt"

    you need to do

      LET STRING SEXT = .txt
      LET FNAME = STRING CONCATENATE FNAME SEXT
Note:
    The total number of characters that DATAPLOT can use for storing functions and strings is set when DATAPLOT is built. The current default (11/2008) is 50,000 characters. Previous versions may set this limit at 1,000 or 10,000 characters. This limit applies to the combined number of characters for all functions and strings.
Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Data Management
Implementation Date:
    11/2008
Program 1:
     
    LET STRING S1 = file
    LET STRING S2 = 23
    LET STRING S3 = .txt
    LET SOUT = STRING CONCATENATE S1 S2 S3
        
    The resulting string SOUT will contain

      file23.txt
Program 2:
     
    .  Assume we have variables X and Y in the files "file1.dat" to
    .  "file10.dat" and we want to plot each of these in turn.
    .
    LET STRING SBASE = file
    LET STRING SEXT = xx
    TITLE CASE ASIS
    LOOP FOR K = 1 1 10
        LET STRING SINDEX = ^K
        LET FNAME = STRING CONCATENATE SBASE SINDEX SEXT
        READ ^FNAME  Y X
        TITLE Data from File ^SOUT
        PLOT Y X
        DELETE Y X
    END OF LOOP
        

Date created: 12/4/2008
Last updated: 12/4/2008
Please email comments on this WWW page to alan.heckert@nist.gov.