> Collections all have a “.length”, read only function.
> 
> For($i;$Col.length-1;0;-1)
>       $Col[$i]…
> End for
> 
> HTH!

For Collections and Objects a for-each loop is recommended because it’s easy to 
read and powerful.
--

Grüße/Regards,
[heubach-media] | Christian Sakowski
[email protected]
Tel: +49/(0)40/41 455 455





> Am 14.11.2019 um 23:19 schrieb David Ringsmuth via 4D_Tech 
> <[email protected]>:
> 
> Doug,
> 
> Collections all have a “.length”, read only function.
> 
> For($i;$Col.length-1;0;-1)
>       $Col[$i]…
> End for
> 
> HTH!
> 
> David Ringsmuth
> 
> From: Douglas von Roeder via 4D_Tech
> Sent: Thursday, November 14, 2019 4:01 PM
> To: 4D iNug Technical
> Cc: Douglas von Roeder
> Subject: Collections Issue
> 
> *C_COLLECTION*($coll_C)
> 
> $coll_C:=*New collection*("Curly";"Moe";"Larry")
> 
> 
> *C_TEXT*($name_T)
> 
> *For each* ($name_T;$coll_C;0;2)
> 
> 
> *ALERT*($name_T)
> 
> 
> *End for each*
> 
> 
> results in alerts for “Curly”, “Moe”, and “Larry".
> 
> 
> 
> 
> *For each* ($name_T;$coll_C;0;2)
> 
> 
> *ALERT*($name_T)
> 
> 
> *End for each*
> 
> 
> 
> results in alerts for “Curly” and “Moe”. That’s expected because the docs
> state “end is excluded”.
> 
> 
> 
> 
> *For each* ($name_T;$coll_C;2;0)
> 
> 
> *ALERT*($name_T)
> 
> 
> *End for each*
> 
> 
> results in no alerts. That’s not expected.
> 
> 
> How does one iterate backwards through a collection? I realize that I can
> reverse the collection and iterate forward through it but there’s
> no contraindication to iterating backward.
> 
> 
> 
> --
> Douglas von Roeder
> 949-910-4084
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************
> 
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[email protected]
> **********************************************************************


**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to