Domino 9 und frühere Versionen > ND6: Entwicklung

String zusammensetzen

(1/4) > >>

andrew22:
hi ho

Ich möchte gern nen Dateipfad zusammensetzen.

Dim test As String

test = "C:\Temp\t........csv"

da wo die Punkte sind kommt immer etwas anderes

sprich der Dateiname ändert sich nur z.B. die ersten 3 Buchstaben bleiben immer gleich und die Endung

wie mache ich das am besten ?!

thx

Thomas Schulte:
test = "C:\Temp\T" + Variable + ".csv"

m3:
Aus der Lotus Notes Designer Online-Hilfe:

--- Zitat ---Concatenate two expressions as strings.
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
--- Ende Zitat ---

ctillmanns:
Dateiname = "Dateiname"
test = "C:\Temp\"+Dateiname+".csv"
Mist Thomas war wieder mal schneller.
Mit dem Hilfeauszug ist die Verwirrung jetzt dafür komplett.

m3:
Wenn Du sie nicht überzeugen kannst, verwirre sie. :D

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln