Hello Michael,
For my actual code I have switched to reading into a mutable buffer and only at
the end convert into an array. This works well:
MyMB = .MutableBuffer~new
qfileIn = .stream~new(InputFile)
DO WHILE qfileIn~lines <> 0
MyMB = MyMB~Append(qfileIn~linein) .endofline)
END
qfileIn~Close
MyArray = MyMB~MakeArray()
Drop MyMB qfileIn
But I am still thinking that there is something that is not right when the same
code works in 4.2 but not in 5.
I also have a performance problem where the same code takes four times as long
in 5.0 than in 4.2 but I will do a separate posting on that.
I would hate to go back to 4.2 ooRexx 5.0 have many nice features.
Hälsningar/Regards/Grüsse,
P.O. Jonsson
[email protected]
> Am 05.07.2017 um 15:41 schrieb Michael Lueck <[email protected]>:
>
> Greetings P.O.
>
> P.O. Jonsson wrote:
>>
>> With the risk of being ridiculed again I provide a test case. To emulate how
>> I normally work I call a function defined as a procedure to open a file,
>> read it line by
>> line to a stem and close it again and return.
>
>
>
> You just reminded me of work on an issue the IBM developers assisted me with
> back in the early 2000's.
>
> /* Read in the file */
>
> /* This code requires at least ORexx 2.1.1 on Win32 - only tested with
> >=2.1.2 */
>
> INstr = file~charin(1, FILEsize)
>
> FINDarray = INstr~makearray()
>
>
> and
>
> /* Write out the file */
>
> /* This code requires at least ORexx 2.1.3 on Win32 */
>
> if file~LineOut(FINDarray~MakeString()) then do
>
> LDSLogging~Logger('OBJECTCUR LDSTextFile~WRITEfile -> Error calling
> LineOut, RC=' || rc)
>
> file~close()
>
> return 0
>
> end
>
>
>
> From what I can still recall about the code I was testing prior to these
> ORexx 2.1.x enhancements, I believe I was comparing to File I/O methods of
> the Array class. The IBM developers said the code within ORexx I was trying
> to make use of "was sort of a nightmare", thus why they created these two new
> methods for me... in order simply to bypass the poorly performing code. (I
> have been always sort of skeptical why the same better performing code could
> not simple be "cut and paste" replace the old code for the Array class File
> I/O methods.)
>
> In both these cases, it got my Rexx code out of having to do an interpretive
> loop. The comment "read it line by line into a stem" was how we were coding
> with CRexx on OS/2... thus that code ported over to Windows and ORexx, as my
> starting point. The ORexx code was ddoooogggggg slow back on ORexx 1.0.3.0
> and ORexx 2.1.x prior to 2.1.3.
>
> I have no ideas how to explain the different run-time duration for multiple
> runs of your same program, sorry.
>
> I am thankful,
>
> --
> Michael Lueck
> Lueck Data Systems
> http://www.lueckdatasystems.com/
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel