On 25.08.2022 14:48, Rick McGuire wrote:
They absolutely do not add linends to the date. The supplied data gets converted into a string and is appended to the array with no additional processing. If there are extra linends, it's because you left them on the line before making the call. WriteError() and WriteOutput() assume you have done any linend processing yourself, WriteXXXBuffered() assumes you are writing a buffer of data with individual lines separated by linends and the separation is handled for you.

You are right. Went back to the handler code (got changed for debugging many times since yesterday) and noticed that for reading an item I did not use the original ReadInput() but ReadInputBuffer().

ReadInputBuffer() adds .endofline to the end, hence this observed behaviour.

---rony



On Thu, Aug 25, 2022 at 8:28 AM Rony G. Flatscher <rony.flatsc...@wu.ac.at> 
wrote:

    WriteOutput() and ErrorOutput()-APIs add a trailing .endofline character to 
the data that get
    output.

    E.g. if "out=.array~new" and using it for output redirection, then doing 
two times
    'WriteOutput("abc")' (causing a total of two items to be output) and upon return 
to Rexx "say
    '['out~makeString']'" will cause the following surprising output:

        [abc

        abc
        ]

    Using Rexx only:

        out=.array~new
        out~~append("abc")~~append("abc")
        say '['out~makeString']'

    yields:

        [abc
        abc]

    So changing/processing the supplied data by appending an .endofline should 
not occur with
    WriteOutput() and ErrorOutput().

    ---rony

    P.S.: ReadInput() will read and return the data unchanged/unprocessed, even 
if it contains
    .endofline (which in Rexx e.g. array[i]  would do as well, returning the 
stored item unchanged).

_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to