« Forget about "IT" and Start Thinking about "BT" | Main| Good Write-Up of Ytria's AgentEZ Tool on DomBlog.de »

Lesson for Notes Veterans: (Sorta) New Way to Get Nth List Element

QuickImage Category  


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!  Here he is discussing the undocumented @GetMember function in a post on SBACode.com:

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.

Your Host

KevinPettitt.jpg
Kevin Pettitt View Kevin Pettitt's profile on LinkedIn

Tools I Use

Idea Jam

Subscribe to This Blog

 Full Posts  Comments

MyYahoo
netvibes Add to Netvibes

Contact

Hosted by

OpenNTF

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor blessed by Lotus Software nor IBM Corporation, nor any of my past or future clients (although they are welcome to do so). The opinions, theories, facts, etc. presented here are my own and in no way represent any official pronouncement by me on behalf of any other entity.

© 2005-2017 Kevin Pettitt - all rights reserved as listed below.

Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution / NonCommercial / ShareAlike