On Wed, Jan 25, 2012 at 11:06:06AM +0100, Arjen Markus wrote: > Hi Andrew, > > On 2012-01-25 10:57, Andrew Ross wrote: > > > If the string contained characters, then just the characters were passed > > (with trailing spaces removed). If a null string was passed (i.e. of > > length 0), then the returned string was a C NULL string. If the fortran > > string was of length > 0, but was all spaces, then a single space was > > passed to C. This seems entirely arbitrary. It made the examples work, > > but wouldn't definitely do what the user expected. > > > > I suggest we continue as we are following Alan's changes, i.e. pass > > EXACTLY the fortran string to C. The onus is then on the user to ensure > > the string is the right length or to strip any unnecessary spaces. We > > can't do this manually since we don't know which trailing spaces are > > necessary and which are not. > > > > This will be an API change for the f95 bindings, and will require > > a number of examples to be updated. Are people happy with this? > > > > Well, what I have been thinking about is the following: > Rather than divine (in the spirit of the old implementation) if trailing > blanks are significant, let the user append an achar(0) as the last > character if trailing blanks are significant. I will rework the > examples to incorporate that. > > It can be as simple as: > > call pllab( 'Tight string ', & > 'String with trailing blanks '//achar(0)) > > We can even define a PL_END_OF_STRING parameter to the module, so that > this implementation detail is hidden. > > That way the changes are minimal - we will need to document this of course.
I like this idea better as most of the time users won't want the trailing spaces. Would be less invasive changes to the examples as well. Andrew ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
