Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-22 Thread Rony G. Flatscher
Just opened a RFE after studying the current DO-keyword syntax. ---rony On 20.02.2019 16:11, Gil Barmwater wrote: > > Just another couple of points: > > 1) the ~supplier message is not needed;  ooRexx will "supply" it > > 2) in the case o

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-20 Thread Gil Barmwater
Just another couple of points: 1) the ~supplier message is not needed;  ooRexx will "supply" it 2) in the case of relation collections, the [] method will return the first item with the specified index so relation collections with duplicate indices would need different handling (thanks Rony fo

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-20 Thread Gil Barmwater
I think we are on the right track but it needs a little tweaking: t=.table~of(("adam","male"), ("berta","female"), ("caesar","male") ) sayt~class":" dowithindexiitemoovert say"#"i":"pp(o) end say say"--- the desired output:" i=1 dowithindexidxitemoovert say"#"i":"pp(idx) "->"pp(o) i=i+1 end say

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-20 Thread Rony G. Flatscher
On 20.02.2019 07:06, Erich Steinböck wrote: > > number a do with  over a table where the indices are not numbers, or over > a set or bag > >   > Use > do with index i item j over c~allItems This is *not* the same collection as "c", but an array of all of the items in the "c" MapCollection! T

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Erich Steinböck
> > number a do with over a table where the indices are not numbers, or over > a set or bag > Use do with index i item j over c~allItems ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Jeremy Nicoll
On Tue, 19 Feb 2019, at 18:01, Rony G. Flatscher wrote: > do idx over dir counter i >say "entry #" i": idx="idx "dir[idx]="dir > end > > > where "counter" would be a subkeyword defining a loop variable which > starts out with "1" and gets increased by one after each loop. It seems to m

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Rony G Flatscher
Erich: How would you number a do with over a table where the indices are not numbers, or over a set or bag where the items are not numbers, etc.? —-rony Rony G. Flatscher (mobil/e) > Am 19.02.2019 um 23:15 schrieb Erich Steinböck : > > That's exactly what you can do using the DO WITH syntax

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Erich Steinböck
That's exactly what you can do using the DO WITH syntax ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Michael Lueck
Greetings Rony, Rony G Flatscher wrote: yes. It is about the beed to number the output while doing a do...over beginning with the number 1 (a numbered list). The old issue that using the do/over syntax, not being able to specify a starting index, correct? Whereas alternate syntax calling

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Rony G Flatscher
Erich, yes. It is about the beed to number the output while doing a do...over beginning wirh the number 1 (a numbered list). Cheers —-rony Rony G. Flatscher (mobil/e) > Am 19.02.2019 um 21:09 schrieb Erich Steinböck : > > Rony, > are you aware of the new `DO WITH INDEX i ITEM j OVER collecti

Re: [Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Erich Steinböck
Rony, are you aware of the new `DO WITH INDEX *i* ITEM *j* OVER *collection*` syntax? ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel

[Oorexx-devel] Ad loop counter on do...over ?

2019-02-19 Thread Rony G. Flatscher
Quite often, when using "do...over" there is a need for having a counter that increases automatically on each loop. Currently one needs to use a separate variable that gets explicitly increased within the loop, e.g.: i=1 do idx over dir say "entry #" i": idx="idx "dir[idx]="dir