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.
Regards,
Arjen
DISCLAIMER: This message is intended exclusively for the addressee(s) and may
contain confidential and privileged information. If you are not the intended
recipient please notify the sender immediately and destroy this message.
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The
Netherlands, Commercial Registration Number 41146461, is not liable in any way
whatsoever for consequences and/or damages resulting from the improper,
incomplete and untimely dispatch, receipt and/or content of this e-mail.
------------------------------------------------------------------------------
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