Calculate average, total or price (including tax) are common tasks in any business application. Collections are an easy way to aggregate your data in a consistent way. With it, this type of calculation becomes very simple, because there are collection methods that do everything for you!
4D v16 R6 opens a wide range of possibilities to manage collections. Merging two collections into one, cloning or just ordering a collection is as easy as calling a method. It saves valuable time, for example, when you need to concatenate two collections, keep only the distinct values, or sort it.
4D v16 R6 provides advanced capabilities to manipulate collections, thanks to 40+ methods to be used with Object Notation. By using them, you’ll be able to write your code in a more efficient way. New code is great, but we also kept in mind that this new code needs to easily integrate with your existing code. This is why we’ve introduced dedicated commands to convert collections to arrays or strings, and vice-versa.
Adding and/or removing elements to and from collections are common programming tasks that developers often encounter. 4D v16 R6 provides over 40 collection methods, including methods specifically dedicated to the addition and removal of elements in a collection. With these methods, you can easily create a stack (FIFO) or queue (LIFO), add new elements at any position, and much more…
4D v16 R6 provides advanced capabilities to manipulate collections, thanks to a series of methods to be used with Object Notation. Over 40 methods are now available, which allow, for example, the ability to add or remove elements in a collection, sort it, search the elements in it and much more! There are so many new possibilities that it is impossible to present them in a single post. This post is the first of a series you don’t want to miss…
4D v16 R4 introduces a new type of variable called Collection. What are these variables intended for? Like Objects or BLOBs, collections can be used to hold almost any kind of variable types like texts, numerics, booleans, objects and even other collections. The good thing is that, all these variables types previously mentioned can be mixed inside the same collection, where arrays must always contain the same type of elements!
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!