user1409217
user1409217

Reputation: 412

Lotusscript evaluate server date?

How to determine a server's date in lotusscript? I've searched around and found no lotusscript way for this. Even some close to usable solution proved to be too long in lotusscript when in @formula you can just use evaluate. What's wrong with my code below?

Dim serverDate, macro$
macro$="@Date(@Now([ServerTime];"devsvr/acme"))"
serverDate=Evaluate(macro$)

Msgbox serverDate

I can't seem to get serverDate to work. There's always error like 'type mismatch' etc. I need it to compare with other date in my code. I've tried changing the last line with each of the following but still doesn't work:

MsgBox CStr(Format(serverDate, "Short Date"))
MsgBox Format(serverDate, "Short Date")
MsgBox CStr(serverDate)

Upvotes: 0

Views: 1101

Answers (1)

Richard Schwartz
Richard Schwartz

Reputation: 14628

There are two things wrong with the code above. The first is that you're not quoting the value properly for macro. You should either be doubling the inner quotes, or using this notation:

macro$=|@Date(@Now([ServerTime];"devsvr/acme"))|

The second problem is that formula language is list-oriented, and LotusScript's Evaluate statement returns lists as arrays, even when there is just a single value in the list. So you need this:

Msgbox serverDate(0)

Upvotes: 4

Related Questions