Lotus Notes / Domino Sonstiges > Projekt Bereich
@Formula-Befehle in Lotus Script abbilden
koehlerbv:
Wenn wir 'ne Sammlung aufbauen, dann sollten die Sources aber ordentlich geschrieben werden und nicht so grauslig wie in den von Dir gefundenen Beispielen. Und ordentlich dokumentiert. Nach einem ersten Blick auf die zweite @ReplaceSubstring-Variante: Was passiert, wenn die Arrays unterschiedlich viele Elemente enthalten ?
Was demzufolge noch gemacht werden sollte: Ordentliche Testszenarien und -dokumentationen !
Was meint Ihr ?
Bernhard
TMC:
@Min
--- Code: ---Function min(a,b)
If a < b Then
min = a
Else
min = b
End If
End Function
--- Ende Code ---
TMC:
@Max
--- Code: ---Function max(a,b)
If a < b Then
max = b
Else
max = a
End If
End Function
--- Ende Code ---
TMC:
@Right
--- Code: ---Function atRight(str_or_list, position, Byval flags%)
' arguments: str_or_list: string or array of strings to search in.
' position: integer or string: position in str_or_list if numeric, else string to search for in str_or_list
' flags option added for R5 - case/pitch sensitivity (see Strright function in developer help).
' return value: same type as str_or_list, containing the portion (of each element, if an array) to the right of 'position'
Dim seekval, c%
If Isarray(position) Then
seekval = position(Lbound(position))
Else
seekval = position
End If
If Isarray(str_or_list) Then
Redim result(Lbound(str_or_list) To Ubound(str_or_list))
For c = Lbound(result) To Ubound(result)
If Vartype(seekval) <> 8 Then
result(c) = Right(str_or_list(c), seekval)
Else
result(c) = Strright(str_or_list(c), seekval, flags)
End If
Next
atRight = result
Elseif Vartype(seekval) <> 8 Then
atRight = Right(str_or_list, seekval)
Else
' change for R5: use Strright instead of Instr and Right
atRight = Strright(str_or_list, seekval, flags)
End If
End Function
--- Ende Code ---
@Word
--- Code: ---Function atWord(s, d$, i%)
If Isarray(s) Then
Dim j
Redim r(0 To Ubound(s)-Lbound(s)) As String
For j = 0 To Ubound(r)
r(j) = atWord(s(j), d, i)
Next
atWord = r
Elseif Len(d$) = 1 Then
atWord = EasyWord(Cstr(s), d, i)
Else
atWord = Word(Cstr(s), d, i)
End If
End Function
--- Ende Code ---
Semeaphoros:
Ja, eine wirklich saubere Sammlung von unterstützenden Funktionen, gut dokumentiert, gut getestet, das ist eine gute Sache, mache ich auch mit.
Navigation
[0] Themen-Index
[#] Nächste Seite
[*] Vorherige Sete
Zur normalen Ansicht wechseln