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.
Remember that Evaluate function return value is variant.
With Evaluate, Formula and Lotus Script can coexist together.