What does this Lotus Script mean?

Lotus Notes
What does this code snippet mean. Can anybody explain it to me?
@Length(@Text(@Month(@Today))) = 2 & @Length(@Text(@Day(@Today))) < 2;:-

Answer Wiki

Thanks. We'll let you know when a new response is added.

The code tests whether the current month number, converted to text, contains two characters AND the current day of the month, converted to text, is a single character. This would be true for the first time in any given year on October 1. It will be true from October 1 to October 9, from November 1 to November 9, and from December 1 to December 9. Because it is a Boolean check that will return either @True or @False, it can only have meaning as a condition clause of an @If statement, a hide-when formula, or a selection statement.

There is little question, however, that the check is, well, questionable. Without a larger context, it is difficult to determine whether the code makes any sense at all. What is so special about the first nine days of the last three months of the year? The chances are better than good that this check, and the code that contains it, can be rewritten in a much more logical manner.

Here’s a tip: You can test formula code in any Notes form.

<li>Compose a Notes document. A mail message would be fine. </li><li>Paste the code into the subject field (this will work in any text-only field. We know the Subject field is text, not formattable rich text, so that’s why I suggested it.). <b>Note:</b> Do not include the trailing semi-colon in this context. If you do, the debugger will assume you are including another line of code. </li><li>Hold down your Shift key, then press F9.</li><li>The formula will evaluate. In this case, it will be “0”.</li>

This technique can be used to test notes formulas, but all variables must be declared within the code you want to test – the debugger does not have a context to the actual document you are testing on, so it cannot access any of its field values.

I know this works in R6.5 and before. I don’t have experience with R7 or later. I also have seen it fail on a user’s machine running R6.5. He has rebuilt his Notes environment for an unrelated reason since then, so it may work there now as well.

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: