How to get a double quote in a text string

From: Mary Haley (haley AT XXXXXX)
Date: Tue Feb 18 2003 - 15:55:07 MST

  • Next message: David Reusch: "Header lines in ascii input files"

    FYI for NCL users:

    A user personally asked me about how to include a double quote as part
    of a text string in NCL, and I thought I'd share the answer I
    received from Dave Brown.

    Use the "integertochar" function:

      http://ngwww.ucar.edu/ngdoc/ng/ref/ncl/functions/ConversionFuncs.html

    to first convert the character that represents a double quote to its
    integer representation. Then, use this new representation as part of a
    string you want to plot, just by concatenating it in the appropriate
    location.

    For example, try the following script:

    load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
    begin
        wks = gsn_open_wks("x11","test")

        dblquote = integertochar(34) ; decimal 34 is a double quote in the
                                        ; standard ASCII table

        title = dblquote + "This is a title with double quotes" + dblquote
        txres = True
        txres@txFontHeightF = 0.03
        gsn_text_ndc(wks,title,0.5,0.5,txres)
    end

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



    This archive was generated by hypermail 2b29 : Tue Feb 18 2003 - 16:00:12 MST