Re: Character

From: murphys AT XXXXXX
Date: Fri Jul 25 2003 - 16:01:32 MDT

  • Next message: Dennis Shea: "Re: Hybrid of Pressure to Isentropic Coordinates"

    Z,

    1) x = "this is a string" ; x is one entity. it is not an
    array. if you wish to convert x to an array of characters,
    then

        y = stringtocharacter(x)

        print(y(0:3)) ; would result in
        (0) t
        (1) h
        (2) i
        (3) s

        etc

    2) if you want to start by creating an array of characters,
    then:

       x = new(4,character)

       x(0) = "t"
       x(1) = "h"

       or x = (/"t","h","i","s"/)

    not it is far easier to create a string and then convert that
    string to an array of characters.

    Sylvia Murphy
    National Center for Atmospheric Research
    Climate and Global Dynamics Division
    http://www.cgd.ucar.edu/csm/support/
    303-497-1720

    >
    > Hi, Could you like to tell me how to write a array of character?
    >
    > timee = new(4,character,"0")
    > timee(0) = "5"
    > timee(1) = "-"
    > timee(2) = ":"
    > timee(3) = "a"
    >
    > or timee = (/"5","-",":","a"/)
    >
    > and how could i change from string "5-:a" to character above?
    >
    > Thanks
    >
    > zhuming
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk

    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Fri Jul 25 2003 - 15:30:57 MDT