|
|
|
|
|
|
|
|
|
|
|
|
|
|
PROGRAMMING POWER
LotusScript's Evaluate command
By Tony Patton
The basic premise of Evaluate is allowing the use of @Functions within LotusScript. Although LotusScript is very poweful, Domino developers often find themselves clamoring for their favorite function in certain situations.
Syntax Evaluate accepts one parameter and returns a Variant object. The parameter contains the @Function code, and the Variant contains the results of executing the specified @Function. Here is the syntax from Lotus Help.
Evaluate ( "macro" [, object] )
|
The macro is a String representation of the Lotus @Formula to be evaluated. It may be a variable or constant. The value had to be a constant in pre-R5 versions, but this was corrected in R5.
The second parameter is optional; it is used to signify the name of a product object (if Lotus is not used). I have never seen this used, so it's not covered in this article.
Return value As previously stated, the return value is returned in the form of a Variant object. The return value of the actual @Formula is text, but the Evaluate function returns a Variant. The first value in the Variant (zero) contains the return value, and an empty return value signals nothing returned from the @Formula or an error.
In action Evaluate usage will depend on your needs and Notes version, but here are a few examples showing Evalute in action.
I always liked the @Adjust formula. It allows easy manipulation of time-date values. The individual components of a time-date may be incremented/decremented accordingly. Here is its syntax from Note help.
@Adjust( dateToAdjust ; years ; months ; days ; hours ; minutes ; seconds ; [ DST] )
Parameters
dateToAdjust Time-date. The single time-date value to be manipulated.
years - Number. The number of years to increment by.
months - Number. The number of months to increment by.
days - Number. The number of days to increment by.
hours - Number. The number of hours to increment by.
minutes - Number. The number of minutes to increment by.
seconds - Number. The number of seconds to increment by.
dst - Keyword. Optional. Specify [InLocalTime] to further adjust the time for daylight savings if the adjustment crosses the boundary and daylight savings is in effect. Specify [InGMT] or omit this parameter to not further adjust the time for daylight savings. The adjustment is such that adding or subtracting in day increments yields the same time in the new day.
|
Now, @Adjust is used in LotusScript. A LotusScript function is used to take advantage of it whenever needed. The function allows the year, month, and/or day portion of a date-time value to be manipulated.
Consider this first example.
Function AdjustDate ( pYear As Long, pMonth As Long, pDay As Long, pDate As Variant ) As Variant
Dim temp As String
temp = |@Adjust([| & Cstr(pdate) & |];| & Cstr(pYear) & |;| & Cstr(pMonth) & |;| & Cstr(pDay) &|;0;0;0)|
AdjustDate = Evalute ( temp )
End Function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Find unused Lotus Notes groups and clean up your address book
Have you ever wanted to get rid of old Lotus Notes groups that were cluttering up your address book, but you weren't sure if they were used? Find Unused Groups can help.
Find Unused Groups will check your ACL, mail, multi purpose and server groups to help you determine if they are used, and who uses them.
Learn how to easily clean up your address book. |
-- Advertisement --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|