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

ICHAR

Name:
    ICHAR
Type:
    Let Subcommand
Purpose:
    Return the ASCII collating sequence index of the characters in a previously defined string.
Description:
    Most modern computer platforms use the ASCII collating sequence to code characters. In the ASCII collating sequence, the integers 0 to 255 are used to represent specific characters. Specifically

    1. 48 - 57 denote the digits 0 to 9
    2. 65 - 90 denote the upper case characters A to Z
    3. 97 - 122 denote the lower case characters a to z

    The other values represent special characters such as quotes and ampersands or non-printing characters such as tabs, carriage returns, or line feeds.

    This command allows you to generate the integer index corresponding to each character in a previously defined string.

Syntax:
    LET <ival> = ICHAR <sorg>
    where <ival> is a parameter or variable containing the ASCII collating sequence index values;
    and <sorg> is a previously defined string.

    If <ival> was previously defined as a parameter, only the value corresponding to the first character in <sorg> is returned. If <ival> was previously defined as a variable, then values corresponding to all characters in <sorg> are returned. If <ival> was previously defined as something other than a parameter or a variable, then an error is printed.

    If <ival> was not previously defined, then it will saved as a parameter if <sorg> has only one character and it will be saved as a variable if <sorg> has more than one character.

Examples:
    LET IVAL = ICHAR S1
Note:
    The string on the right hand side of the equal sign must be a previously defined string. String expressions are not allowed. So

      LET IVAL = ICHAR ".dat"

    should be coded as

      LET STRING S1 = .dat LET IVAL = ICHAR S1
Default:
    None
Synonyms:
    None
Related Commands: Applications:
    Data Management
Implementation Date:
    11/2008
Program:
     
    LET STRING S1 = file23.dat
    LET IVAL = ICHAR S1
        
    The resulting values of IVAL are 102, 105, 108, 101, 50, 51, 46, 100, 97, and 116.

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