Doesn’t the option until/while syntax fit the bill for early exit? I agree an 
automatically-maintained index would be nice, though.

Jeremy

> On 5 May 2020, at 19:13, James Crate via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> In 4D, when enumerating collections or entity selections, about half the time 
> I want an index for progress calculation, and other times I have to use the 
> indexed for loop because I want to early exit. 
> 
> For other languages, providing the index on enumeration varies by language 
> and enumeration construct, but most have an enumeration construct that 
> provides an index. Almost all support break.
> 
> So 4D’s implementation could be considered more redundant, less 
> feature-complete. If an index were provided instead of start/end, and you 
> could set that index to .length to exit the loop, we’d pretty much never have 
> to use an indexed loop for a collection or entity selection.
> 
> Jim Crate

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to