Last update November 15, 2003

DWiki /
For Each



A function that takes a collection, a command and executes the command for each item in the collection. Usually used with lists, but may be used with any kind of collection.

Using /DeimosTemplateLibrary:

    instance TArrays(int) arrays;
    const int[] numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
    void print(int i) { printf("%d\r\n");};
    arrays.forEach(numbers, print);

(From DWiki)
FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: November 15, 2003 5:25 (diff))