Lesson for Notes Veterans: (Sorta) New Way to Get Nth List Element
When did Notes 6 come out? You know, the version with the entirely rewritten @Formula language engine. Five years ago or so, right? Well, long enough ago that I'm ashamed to admit I only recently learned you don't need to use nested @Subset calls to get the 17th (or whatever) element of a list. From the Domino Designer Help:
Lists can be subscripted to read (but not write) elements. For example, Categories[2] is the second element of the Categories field.
It just goes to show you how easy it is for "experienced veterans" to overlook new (and better) ways of doing something we "already know how to do." And Fabio will have to forgive me for picking on him, but I'm not the only one!
To get a specific element from a list you are normally forced to combine 2 @Subset.
Like this:
tmpList := "aaa":"bbb":"ccc":"ddd":"eee";
tmpMember := @Subset(@Subset(tmpList; 3); -1);
This returns listelement "ccc"
Now you can use @GetMembers instead.
Like this:
tmpList := "aaa":"bbb":"ccc":"ddd":"eee";
tmpMember := @GetMembers(tmpList; 3; 1);
Returns the same result.
At least I'm in good company.


- 

