Re: Bug with str_capital in 6.1.0-beta

From: Ryan Pavlick <ryan.pavlick_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 27 2012 - 08:44:58 MDT

Oops, made a mistake in my workaround.

It should have read:

strs = "aasfdadfs asfadsf asdfadf"
old_strs = strs
new_strs = str_capital(strs)
strs = old_strs

On Mon, Aug 27, 2012 at 4:38 PM, Ryan Pavlick <ryan.pavlick@gmail.com> wrote:
> NCL developers,
>
> I found a bug in the 6.1.0-beta in the function str_capital.
>
> The function should return strings with all words capitalized in every
> input string. In the latest version, it also changes the input
> string.
>
> I provided some output below to show illustrate the problem.
>
> A quick workaround for anyone experiencing problems is:
>
> strs = "aasfdadfs asfadsf asdfadf"
> old_strs = strs
> new_strs = str_capital(old_strs)
> strs = old_strs
>
> Best regards,
> Ryan Pavlick
>
>
>
>
> Copyright (C) 1995-2011 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.0.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> +
> + strs = (/"NCL has many features common to modern programming languages,",
> + "including types, variables, operators, expressions,",
> + "conditional statements, loops, and functions and procedures."/)
> + new_strs = str_capital(strs)
> + print(new_strs)
>
>
> Variable: new_strs
> Type: string
> Total Size: 24 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [3]
> Coordinates:
> (0) NCL Has Many Features Common To Modern Programming Languages,
> (1) Including Types, Variables, Operators, Expressions,
> (2) Conditional Statements, Loops, And Functions And Procedures.
> + print(strs)
>
>
> Variable: strs
> Type: string
> Total Size: 24 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [3]
> Coordinates:
> (0) NCL has many features common to modern programming languages,
> (1) including types, variables, operators, expressions,
> (2) conditional statements, loops, and functions and procedures.
>
>
> Copyright (C) 1995-2012 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.1.0-beta
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> + strs = (/"NCL has many features common to modern programming languages,",
> + "including types, variables, operators, expressions,",
> + "conditional statements, loops, and functions and procedures."/)
> + new_strs = str_capital(strs)
> + print(new_strs)
>
>
> Variable: new_strs
> Type: string
> Total Size: 24 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [3]
> Coordinates:
> (0) NCL Has Many Features Common To Modern Programming Languages,
> (1) Including Types, Variables, Operators, Expressions,
> (2) Conditional Statements, Loops, And Functions And Procedures.
> + print(strs)
>
>
> Variable: strs
> Type: string
> Total Size: 24 bytes
> 3 values
> Number of Dimensions: 1
> Dimensions and sizes: [3]
> Coordinates:
> (0) NCL Has Many Features Common To Modern Programming Languages,
> (1) Including Types, Variables, Operators, Expressions,
> (2) Conditional Statements, Loops, And Functions And Procedures.
> +

-- 
------------------------------------------
Ryan Pavlick
Biospheric Theory and Modelling Group
Max Planck Institute for Biogeochemistry
phone: +49.36.41.57.6223
web: http://gaia.mpg.de
------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 27 08:45:28 2012

This archive was generated by hypermail 2.1.8 : Tue Aug 28 2012 - 08:53:45 MDT