On Tue, Mar 20, 2018 at 4:48 PM, Chip Scheide via 4D_Tech < [email protected]> wrote:
> It seems to me (at this point), that a collection is just a record, > perhaps it is more flexible, being definable on the fly, but still a > record. > > Collection is some combination of object and array. Like array, collection has indexed elements, so if A is collection, you can use A[$i] to access element of collection. Collection, like an object, can be passed to or returned as return parameter of method. There are differences - collections elements are numbered from 0 to length - 1, collection elements can be of different type, while array elements are all of the same type, array elements are numbered 1 to Size of array and there is special element 0 etc. Collection has a lot of method working on them - not only Sum, Min, Max, sort and other like for arrays, but many methods inspired by Javascript, like concat, join and tens of others. Collection are interesting in context of new database object syntax, when they replace selections - query will return collection of records that you can then access through index. -- Peter Bozek ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

