On Tue, 15 Oct 2002, Adolf Stips wrote:
> Hi everybody,
> by doing some data conversions I have to deal several
> times with strings - but are there any functions available
> for doing this (finding forinstance the substring "lat" in some longer
> extracting only the first 5 characters from a string ....) ??
> I couldn't see anything on the reference manuals.
Well, it can be done but not via direct NCL syntax. Rather,
a combination of the stringtochar function; subset the resulting
array (note its' dimensions); then chartostring
If you do this a number of times it might be best to
set up some function to do this.
> The second problem is related to printing date/time strings and seems
> to me like an error.
> eg, my string is:
> 01/02/1999 (12:00)
> which in my opinion is a valid time format, when printing it is also okay,
> but NCL things different when I try to put it on a postcript plot
> (as res@tiMainString = "01/02/1999 (12:00)")
> for eg: gsn_csm_contour_map
That is because : is a special test function code for graphics
You can manually reset this via the appropriate resource.
Or you could put the following file into your home
directory and call it .hluresfile. This is what
we suggest. This sets a bunch of resources (eg:
white background abd black foreground)
! comments for ".res" files are preceded by a "!"
! remember quotations are not used in .res files
! White background/black foreground
*wkForegroundColor : (/0.,0.,0./)
*wkBackgroundColor : (/1.,1.,1./)
! Font stuff
*appClass*Font : helvetica
! Function Codes [Default is a colon ]
*TextFuncCode : ~
! Set size of x11 window
*wkWidth : 700
*wkHeight : 700
ncl-talk mailing list
ncl-talk AT ucar.edu
This archive was generated by hypermail 2b29 : Tue Oct 15 2002 - 07:37:06 MDT