Re: Using two sprinti calls in one string

From: Ciara O'Hara <cohara1985_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 06 2014 - 09:20:00 MST

Thanks Kyle,

The '+' error was a typo, I had had it correct before, but through deleting and retyping I lost it.

I thought I had tried that solution (but then thought it was too silly to type), but I must have gotten it wrong because I've tried it again and it's working now,

Thanks,
Ciara

From: ksgriffin2@wisc.edu
Date: Thu, 6 Mar 2014 10:10:26 -0600
Subject: Re: Using two sprinti calls in one string
To: cohara1985@hotmail.com
CC: ncl-talk@ucar.edu

Hi Ciara,
If that is the exact code you have in your script, you have two problems. First, you should also always use i in the format string of sprinti, regardless of the variable you are using. You should also add a + after your first sprinti call to ensure proper concatenation of the strings (although it seems to have worked partially without that +, which is interesting). The end of your string should look more like this:
sprinti("%0.4i",i) + " / " + sprinti("%0.4i",j)

See examples 2 and 3 on the sprinti page for more guidance.
http://www.ncl.ucar.edu/Document/Functions/Built-in/sprinti.shtml

Kyle----------------------------------------Kyle S. GriffinDepartment of Atmospheric and Oceanic Sciences University of Wisconsin - MadisonRoom 14211225 W Dayton St, Madison, WI 53706Email: ksgriffin2@wisc.edu

On Thu, Mar 6, 2014 at 10:01 AM, Ciara O'Hara <cohara1985@hotmail.com> wrote:

I want to add a title to my graph that says "Average Winter Temperature i/j" where i and j are years that the script is running through.

The script I have is:

but the title I am getting is: Average Winter Temperature i /

The second year does not appear.

Can anyone tell me how I can use two sprinti calls in one string?

Regards,
Ciara

                                               
_______________________________________________

                                               

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 6 09:20:15 2014

This archive was generated by hypermail 2.1.8 : Fri Mar 14 2014 - 15:08:52 MDT