|
|
LotusScript Quiz: the "+" operator
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 seperator, 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 ;-)
--------------------- http://feedproxy.google.com/~r/marcusfoerster/~3/c7R7s0sRljI/lotusscript-quiz-operator.html Mar 01, 2010 2 hits
| Recent Blog Posts |
Sorry, no records were found!
|