Greetings ooRexx'ers, Gilbert Barmwater wrote:
And, yes, I know that stems are NOT ordered collections!
Well Stems may operate in two modes... 1) Ordered where .0 is the number of stored items and increment .# is the ordered storage locations 2) Sky's the limit! And Rony, I remind you that there are those old methods probably dating back to Object Rexx v1.x that had very poor performance. Glanging at my Text File class changelog.... /* FILENAME : LDSTextFile.cls */ /* TYPE : Open Object Rexx - OS/2, Win32, Linux, AIX */ /* DESCRIPTION : Class for handling text files */ /* */ /* AUTHOR : Michael D Lueck */ /* mlu...@lueckdatasystems.com */ /* */ /* NEEDS : LDSFileSystem.cls */ /* LDSRexxUtil.cls */ /* */ /* USEAGE : */ /* */ /* REVISION HISTORY */ /* */ /* DATE REVISED BY DESCRIPTION OF CHANGE */ /* ---------- ---------- ------------------------------------------------------- */ /* 1999/10/31 MDL Initial Creation */ /* 2000/06/04 MDL Change internal FINDarray from an array to a stem to */ /* support IBM extended SysUtil stem functions */ /* 2000/08/08 MDL Change to add GETlogging to set the debug/verbose flags */ /* 2000/10/25 MDL Moved STEM API's business logic to LDSRexxUtil */ /* 2000/10/27 MDL Added Test method for proper init error detection */ /* 2000/12/18 MDL Added Empty Method */ /* 2001/01/06 MDL Changed empty lines to =0 */ /* 2001/06/17 MDL Changed to use Array objects vs Stem objects for memory */ /* 2002/07/11 MDL Fixed bug in INSERTline where it was still calling a stem */ /* related method vs the array related one */ /* 2004/05/11 MDL Change to READfile to use new HighPerf I/O option */ /* 2004/05/12 MDL Added support for global trace options within Object CUR */ /* 2004/09/09 MDL Change to WRITEfile to use new HighPerf I/O option */ In 2001 I switched from Stem based storage to Array based storage. So I suspect there was old ORexx v1.x methods to read and write from files to Stem objects which performed poorly, so I had to abandon Stem storage to seek after better performance. Then IBM added some High Performance I/O methods for accessing Array objects.... From READfile: /* Check for how many lines the file has */ FILEsize = file~command('QUERY SIZE') /* 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() From WRITEfile: /* 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 >>> So seems the added methods were the MakeArray() method of the String class and the MakeString() method of the Array class. <<< Man.... where did time go.... 1999 to 2004.... 20+ years have transpired! Anyway, evidently there were some ORexx API's meant to map in/out of Stem objects, which were the poor performers. Since the topic is making API's to bridge between files and ooRexx collection classes, I thought to revisit what was there and not performing well, back then. Hopefully that old ORexx v1.x code might be improved. I would not mind in the least being able to interchangeably use an Array or a Stem storage class. That would be cool! (+1) I just do not think the ooRexx interpreter should impose a significant performance penalty for using an Array versus a Stem to store lines of a Text file. I am thankful, -- Michael Lueck Lueck Data Systems http://www.lueckdatasystems.com/ _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel