Well, its sure been a long time since I did a really heavy duty new Lotus Notes Client application with a full blown user interface. I have to admit, I've really had to reach back into that back of tricks from way back when. I've also had to refresh on the newer stuff -- embedded views, action button drop downs, and all those front end LotusScript objects that us back-end developers eschew.
In all this, I was trying really hard to move smoothly from one document to the composition of another in code, and kept looking for a way to call the action buttons with front end objects in LotusScript. This was because the code behind the action buttons was in Formula Language and has @Commands in it. I didn't fancy trying to reproduce all that just as I'm finishing the flow of the application and working on fit and finish.
Of course, it turns out I didn't need to try that hard. Thanks to (mostly) Damien who added huge new features to the @Functions in version 6 before leaving the company formerly known as Iris for a position with Kubisoft, there wasn't any need to go through all the trouble of doing any of that work in LotusScript in the first place. The two things I really needed were already there -- and very powerful at that.
First, loops. Easy as pie with @For( ) -- it works just like a loop in any language. You set an initial state, a logical test, and a state change -- then put your code in. In fact, @For() is more like modern languages than the old BASIC style of For and Next being separated. There's a picture of it in action here.
The other thing that used to drive me nuts, was when you'd compose a new document with @Command([Compose];"Formname"); but then you'd have no context to it. If you tried to follow with @SetField("fieldname"; "Value") you'd find out you were still working on the old document, not the newly composed one. Argh! Well, the way around that is a perfectly simply call to @UpdateFormulaContext. It does just what you expect, and what you thought you were getting when you composed the document.
And for you "@Functions aren't real code" snobs -- and I know you're out there -- let me tell you that there are a lot of times when coding with @Functions produces faster code with less typing that is very well supported on all the Lotus Notes platforms. So get your nose down out of the air before it rains and you drown.
Real programmers use the right tool for the job.
This program has been brought to you by....
@For, @UpdateFormulaContext, Damien, and the letter I.
(Ok, maybe not " I" but I really liked the capitol " I" song when I was a kid)
Comment Entry |
Please wait while your document is saved.
Welcome to the wonderful world of @functions! Pretty kewl, huh? It is amazing
what you can do with them now, and any developer who doesn't consider them a
vital part of their toolkit is not utilizing all the power of Notes/Domino
available to them.
Rock