Evaluate, the bridge between Lotus Script and @Formula
October 3rd, 2009 by bfebrianIn lotus notes programming, I usually use Formula for simple program and Lotus Script for more complex program. I try to avoid many lines of Formula, because it difficult to read and not structured.
But, Formula have many method that Lotus Script do not have, like @Implode and @Explode. Even we can write our ownLotus Script function to do that, it just a waste of time and energy.
But, we have Evaluate in Lotus Script.
Evaluate function is one of many of my favorite functions, because it able to run Formula and than pass the result of that Formula intoLotus Script variable (variant).
This is the syntax of Evaluate
variant = notesSession.Evaluate( formula$, doc )
We can use Evaluate function to pass the result from any kind of Formula, from simple formula like @UserName to more complex formula like @Implode.
Recently, I use Evaluate in my program, to shorten the length of theLotus Script.
I need to calculate the difference in days between two date, but only in business days ( so saturday and sunday will not be counted also holidays).
Formula already have the function to calculate that, so I don’t need to create another lengthly Lotus Scriptfunction just to calculate that. I use the formula instead, so I need the Evaluate function.
varDay=Evaluate(“@BusinessDays(@Date(datFinal);@Date(@Now);1;datPublicHoliday)”,doc)
Remember that Evaluate function return value is variant.
With Evaluate, Formula and Lotus Script can coexist together.
Popularity: 12% [?]
Tags: evaluate, formula, lotus-domino, lotus-notes, lotus-script, ProgrammingSave to del.icio.us | Stumble It! | Submit to Netscape | Digg This!
Related Posts:
Posted in Lotus Notes and Domino, Programming | 1 Comment »


October 17th, 2009 at 1:26 am
[...] In lotus notes programming, I usually use Formula for simple program and Lotus Script for more complex program. I try to avoid many lines of Formula, because it difficult to read and not structured. But, Formula have many method that Lotus Script do not have, like @Implode and @Explode. Even we can write our ownLotus Script function to do that, it just a waste of time and energy. But, we have Evaluate in Lotus Script. Evaluate function is one of many of my favorite functions, because it able to run Formula and than pass the result of that Formula intoLotus Script variable (variant). This is the syntax of Evaluate variant = notesSession.Evaluate( formula$, doc ) We can use Evaluate function to pass the result from any kind of Formula, from simple formula like @UserName to more complex formula like @Implode. Recently, I use Evaluate in my program, to shorten the length of theLotus Script. I need to calculate the difference in days between two date, but only in business days ( so saturday and sunday will not be counted also holidays). Formula already have the function to calculate that, so I don’t need to create another lengthly Lotus Scriptfunction just to calculate that. I use the formula instead, so I need the Evaluate function. varDay=Evaluate(”@BusinessDays(@Date(datFinal);@Date(@Now);1;datPublicHoliday)”,doc) Remember that Evaluate function return value is variant. With Evaluate, Formula and Lotus Script can coexist together. Download Free Article Spinner Thanks. [...]