Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: Giana am 30.05.02 - 09:32:22
-
Ich benötige unbedingt einen Vergleich der 3 im Betreff genannten Programmierungssprachen - kann mir einer helfen ? ???
Brauche nur 3 kurze Programmcodes, die eigentlich letztendlich alle zum gleichen Ziel führen.
-
Hallo,
mit lotus script kannst Du mehr als mit Formelsprache,
ist aber nicht web tauglich, deshalb brauchst du dann wahrscheinlich noch java script.
Beispiele für Formeln und LScript findest du in fast jeder
Notes DB.
in Lotus Script kann man z.B. Schleifen, in Formelsprache nicht
Beispiele für alles 3 , die das gleiche machen hab ich leider nicht
Ute
-
OK, dann wollen wir mal. Hier als Beispieö die Funktion ReplaceSubstring
zunächst Javascript
function replaceSubstring (inputString, badString,
goodString, caseSensitive) {
fixedReplace = "";
UI = inputString;
UB = badString;
if ((caseSensitive != 1) && (caseSensitive != true)) {
UI = inputString.toUpperCase();
UB = badString.toUpperCase();
}
badEnd = -1;
badLoc = UI.indexOf(UB);
if (badLoc != -1) {
for (x=1; (badLoc != -1); x++) {
fixedReplace = fixedReplace +
inputString.substring((badEnd +
1), badLoc) + goodString
badEnd = badLoc + UB.length - 1;
badLoc = UI.indexOf(UB, (badLoc + 1)); }
fixedReplace = fixedReplace +
inputString.substring((badEnd + 1),
inputString.length); }
else { fixedReplace = inputString; }
return fixedReplace;
}
und jetzt in LotusScript
Function ReplaceSubstring(sSource As String, sFrom As String, sTo As String) As String
Dim sResult As String
Dim i As Integer, iLenFrom As Integer, iLenRslt As Integer
i=0
iLenFrom=Len(sFrom)
sResult=sSource
Do While(i < Len(sResult))
i=i+1
If Mid$(sResult, i, iLenFrom ) = sFrom Then
iLenRslt=Len(sResult)
sResult=Left$(sResult, (i-1)) + sTo + Right$(sResult, iLenRslt - ( (i-1) + ( iLenFrom ) ) )
End If
Loop
ReplaceSubstring=sResult
End Function
und letztendlich als @Formel
@ReplaceSubstring(Quelliste ; ÄndernVonListe ; ÄndernInListe)
eknori