Search DominoPower's 10,675 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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


1  ·  2  ·  3  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
What to look for in a Domino-based document management solution
Understanding Domino.doc end-of-life options
When the debugger won't debug hidden code that isn't hidden
What to do if the LotusScript debugger won't single-step over code
Top 10 ways to launch and build a Lotus consulting practice (with a little help from the Beatles)
Troubleshooting an OpenSuse Notes install
Incident report: denial of service attack against ConnectedPhotographer.com
Latest Lotus Headlines
SnTT - Enabling ALL the bells and whistles!
Tivoli Data protection causes Domino to crash
Fun when running DB2 CLP scripts
Introducing Flippr, the easy way to admin Quickr
DXL and fake security
Using search forms in IBM Workplace Collaborative Learning 2.7
Schmidt, Freed, and Gering on the OVF Toolkit
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Eight steps to successful and reliable home backups
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Can Outlook run when it's not running (and other mysteries)?
-- Advertisement --

PDF Conversion for Lotus Notes
Convert Lotus Notes documents to PDF for sharing, archiving or web printing.

  • 1-step PDF: As easy as clicking a Lotus Notes toolbar icon
  • Archive email folders or views as a self-contained PDF
  • Convert any document collection into a PDF file
  • Produce print-quality output from Web applications
  • Client side or Server side conversion
  • Doesn't require any DLL files
  • LotusScript API for developers


Ready to learn more?
-- Advertisement --

Easy Domino Access: Remove Passwords, End Login Prompts, Reduce Password Management
PistolStar's Password Power provides browser-based single sign-on to Lotus Domino, Sametime and Quickr with the enhanced security of the Kerberos or NTLM authentication protocol.

  • Full support available for NTLM authentication protocol in non-Active Directory environments
  • Seamlessly integrate Microsoft Active Directory and the Kerberos authentication protocol
  • Leverage Active Directory password policies to unify Lotus applications


Learn more about Password Power's powerful, advanced functionality.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2009, ZATZ Publishing. All rights reserved worldwide.
Editor's Login