For i = 1 To count
doc.d + i = irgendwas
next idoc.feldname=...
ist irgendwie auch schlechter Stil
Das ist in vielen Kontexten eben auch egal. In vielen Fällen wird keiner die eingesparte Zeit merken.
Die Extended Class Syntax hat aber auch Nachteile gegenüber ReplaceItemValue:
1. Die Performance ist wesentlich schlechter, da der Compiler erst nach der Property/Methode sucht und dann - nachdem er keine gefunden hat - das als Abkürzung für ReplaceItemValue erkennt.
2. Aus 1 ergibt sich dann sofort das Problem: Wenn es DOCH eine Property gibt, so führt das zu Fehlern. Das ist bspw. der Fall, wenn in einer neuen Notes-Version eine neue Property hinzukommt.Das ist ein Argument. Mit einem vernünftigen Test-Prozess bei einem upgrade auf die neue Version, in der das implementiert ist, sind die Kosten möglicherweise nicht besonders hoch.
Akutelles Beispiel (wurde auch hier im Forum behandelt): Lock
ein doc.Lock = "1" funktioniert dann eben nicht mehr.
Und sowas kann mit ReplaceItemValue nicht passieren.
.....aus folgenden Gruenden:Es muss wirklich schwer sein, in der Notes Designer Hilfe im Index "String Conc" einzugeben. Damit wirst Du nämlich DIREKT auf den Hilfetext "String concatenation operators" geleitet.
ad a) zeig mir, wo das steht
Concatenate two expressions as strings.Ansonsten ist das Thema jetzt für mich erledigt. Viel Spass weiterhin noch.
Ampersand (&) operator
Syntax
expr1 & expr2
Elements
expr1, expr2
Any String expressions, or any of the following:
Numeric expression: LotusScript converts it to its text representation. In the case of Boolean data types, 0 becomes "False," and any other number becomes "True."
NULL: LotusScript treats it as an zero-length String value when concatenated with the other expression. If both expressions are NULL, the result is NULL.
EMPTY: LotusScript treats it as a zero-length String value.
Return value
The result is a String or a Variant of type String, if either of the operands is a Variant.
Usage
Use the ampersand (&) operator to ensure a concatenation operation. The plus (+) operator also concatenates two character strings, but LotusScript determines whether to interpret the plus as a concatenation operator or an addition operator on the basis of the operands in the expression in which it appears.
Examples
Dim x As Variant
x = 56 & " Baker St."
Print x ' Prints "56 Baker St."
anInt% = 123
aString$ = "Hello"
anotherString$ = "world"
varV = NULL
Print aString$ & ", " & anInt% & " " & varV & _
anotherString$ & "."
' Output: Hello, 123 world.
Plus (+) operator
Syntax
expr1 + expr2
Elements
expr1, expr2
Any String expressions, or any of the following:
Numeric expression: LotusScript converts it to its text representation (if plus is interpreted as concatenation).
NULL: LotusScript treats it as NULL. If either expression is NULL, the result is NULL.
EMPTY: LotusScript treats it as a zero-length String value.
Return value
The result is a String or a Variant of type String, if either of the operands is a Variant.
Usage
Use the ampersand (&) operator to ensure a concatenation operation. The plus (+) operator concatenates two character strings, but LotusScript determines whether to interpret the plus as a concatenation operator or an addition operator on the basis of the operands in the expression in which it appears.
For example:
Print 100 & "200"
' Output is 100200, because & is always
' a concatenation operator
while
Print 100 + "200"
' Output is 300, because + was interpreted
' as addition operator
Print "100" + "200"
' Output is 100200, because + was interpreted
' as concatenation operator
See Also
Table of string operators
Overview of expressions and operators
String relational(comparison) operators