Skip to main content link. Accesskey S
  • Help
  • IBM Logo
  • IBM Notes and Domino Application Development wiki
  • All Wikis
  • All Forums
  • THIS WIKI IS READ-ONLY. Learn more...
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • IBM Redbooks
  • API Documentation
Search
Community Articles > Programming > Using the LotusScript "+" operator with a String/Integer mix
  • Share Show Menu▼
  • Subscribe Show Menu▼

About the Original Author

Click to view profileMarcus MF Foerster
Contribution Summary:
  • Articles authored: 17
  • Articles edited: 13
  • Comments Posted: 7

Recent articles by this author

When 38.3 - 38 equals 0.299999999999997... and what to do about it

Obviously I forgot about the "fraction()" function, so I removedchanged parts of this article (thanks @Mario for the hint) :)   If you need the digits behind the decimal seperator of a number, you might subtract the integer of the number from the number itself: 1.3 int(1.3) e.g. would result ...

When rounding 0.5 equals 0... and what to do about it

Do you know the difference between rounding a number commercially and rounding it mathematically? Notes does... This is, why in Formula @Round(0.5; 1) equals 1, but the equivalent in LotusScript round(0.5, 0) equals 0... Wonder if round(1.5, 0) equals 1? No, the result is...: 2 The reason is, that ...

The third SaveOptions value, or How to suppress the "Do you want to save this document?" message box in Notes

Yes, SaveOptions understands more than just "0" or "1": Did you ever face the problem, that Lotus Notes keeps asking if you want to save the current document, even though you just did? Picture the following scenario: A user creates a document with a certain form that contains a "Change Field ...

Pitfall on NotesUiDocument vs. NotesDocument field changes - unexpected "Reload"

When performing mixed changes on fields, i.e. changing fields in a NotesUiDocument and others in the corresponding backend NotesDocument, it is very important to make sure that they do not have any sideeffects on each other. Could be ugly...   To see what I mean, try this one:   Build a simple ...

Forgotten Notes Features: $PaperColor

Anyone remember, and actually uses (besides in his memos, maybe not knowing) the field "PaperColor" in Lotus Notes documents? Using this field, you can set a dynamic background color in your documents. The field needs to be numeric and contain a number from 1 to 238; usually this field will be ...
Community articleUsing the LotusScript "+" operator with a String/Integer mix
Added by Marcus MF Foerster on March 12, 2010 | Version 1
  • Actions Show Menu▼
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: LotusScript Operator String Integer
As you (if you are a LotusScript developer ;-)) know,

- Msgbox "a" + 3 results in a type mismatch error.
- Msgbox "a" & 3 delivers "a3".

Now, do you know what the result of this line of code is?

Msgbox "1" + 1


A. "11".
B. 2.
C. A type mismatch error occurs

Solution: B - LotusScript tries to parse the string, and adds the two values.

This also works with strings like "1.1" or "1,1". In my Notes environment "," is the decimal separator, so "1,1" + 1 results in 2,1 and "1.1" + 1 results in... 12.

The code does not work, however, with "1a" + 1, even though val("1a") returns 1. LotusScript seems to parse the string differently here - mh...

Still... please do NOT use this - this is evil coding ;-)

About the Author
Marcus Foerster works as Systems Architect for Pentos AG in Munich, Germany. His focus lies on the application side, creating collaboration systems for users, groups and enterprises to get their daily work done. This approach includes integrating complex workflows with intuitive user interfaces, using Lotus Notes/Domino with Adobe Flex and other Web technologies.
Read more in Marcus' blog: http://marcus.foerster.com/blogexternal link


  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (1)
collapsed Versions (1)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (1)Mar 12, 2010, 7:59:51 AMMarcus MF Foerster  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedHelpAbout
  • IBM Collaboration Solutions wikis
  • IBM developerWorks
  • IBM Software support
  • Twitter LinkIBMSocialBizUX on Twitter
  • FacebookIBMSocialBizUX on Facebook
  • ForumsLotus product forums
  • BlogsIBM Social Business UX blog
  • Community LinkThe Social Lounge
  • Wiki Help
  • Forgot user name/password
  • About the wiki
  • About IBM
  • Privacy
  • Accessibility
  • IBM Terms of use
  • Wiki terms of use