Domino 9 und frühere Versionen > Entwicklung
Felder auslesen?
Glombi:
Du hast recht, ich nehme meinen Einwand zurück. Der & Operator macht tatsächlich eine Typenkonvertierung. Ich hatte es bis heute jedoch nie (absichtlich) verwendet.
Andreas
rar:
Andreas,
der Code
Dim text As String
Dim zahl As Integer
zahl = 5
text = " Nummer " & zahl & " lebt!"
Msgbox text
läuft mit 6.5 (ist das eine vernünftige Notesversion?) einwandfrei weil:
--- Zitat ---Ampersand (&) operator - Concatenate two expressions as strings.
--- Ende Zitat ---
Glombi:
Ja, Du hast recht. Ich habe mich da geirrt. :-[
Hier stimmt die Doku mal ausnahmesweise ;D
Was die Notes Versionen angeht: Ich habe leidvoll erfahren, dass Notes 6 wesentlich pingeliger ist als Notes 5. Insbesondere in gemischten Notes/Web Anwendungen kann das schon nerven und man muss einiges ändern, wenn man nicht sehr sauber schon in R5 programmiert hat.
Andreas
Glombi:
Ich habe das mal mit dem Operator + getestet, der in Script überladen ist.
Sub Click(Source As Button)
Dim s As String
Dim i As Integer
s = "test"
i = 1
Msgbox s & i
Msgbox s + s
Msgbox i + i
Msgbox s + i 'Hier knallt's dann
End Sub
Dazu aus der Hilfe:
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.
Also work's as designed.
Irgendwie widerstrebt es mir, den & so zu verwenden. Aber man lernt ja nie aus.
Andreas
koehlerbv:
Ich hoffe, mir fällt das demnächst wieder ein, wo das mit dem Ampersand dann doch nicht funktioniert ...
Ich halte es hier aber mit Andreas: Es ist unsauberes Coden, es liest sich schlechter. Ich mach's einfach nicht.
Bernhard
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln