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

LET STRING

Name:
    LET STRING
Type:
    Analysis Command
Purpose:
    Defines a string.
Description:
    In addition to parameters and vectors of real numbers, DATAPLOT allows you to define strings. Strings can be created using either the READ STRING or the LET STRING commands.

    Strings are often used with the substitution character ("^" by default). The substitution character inserts the value of a previously defined parameter or string into a DATAPLOT command. For example,

      LET STRING S = Glucose in Serum
      TITLE ^S

    Although in this example we could have simply entered the string directly in the title, this capability can be useful in writing general purpose macros and within loops.

Syntax:
    LET STRING <sout> = <sin>
    where <sout> is the name of the string;
    and <sin> is an expression that defines the contents of the string.
Examples:
    LET STRING S1 = Sample String
Note:
    Internally, Dataplot stores functions and strings together. However, there is one important distinction between LET STRING and LET FUNCTION. The LET STRING comamnd will preserve the case of the text used to define the string while LET FUNCTION will automatically convert lower case characters to upper case.
Note:
    Dataplot does not currently support string arrays. You can mimic this capability to some extent using the substitution character ("^" by default). For example, you could do somehting like
     
    let string s1 = Title for Plot One
    let string s2 = Title for Plot Two
    let string s3 = Title for Plot Three
    loop for k = 1 1 3
         title ^s^k
         plot y^k x
    end of loop
        
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:
    Pre-1987
Program:
     
    .  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 S1 = file
    LET STRING S3 = .dat
    TITLE CASE ASIS
    LOOP FOR K = 1 1 10
        LET STRING S2 = ^K
        LET STRING FNAME = ^S1&^S2&^S3
        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.