Domino 9 und frühere Versionen > ND6: Entwicklung

NSD bei Replace in Agent

(1/1)

MadMetzger:
Hallo!

Ich bin hier schon halb am Ausrasten... Ich habe einen Agenten, der in einem bestimmten Feld einen bestimmten Wert ersetzen soll in vielen Dokumenten. Ich hole mir dazu alten und neuen Wert aus einer PickListStrings und arbeite zum Ersetzen mit dem Replace. Hier ein Ausschnitt aus dem Code:

--- Code: ---oldvalue = currentDoc.GetItemValue(FIELD_NAME$)
[glow=red,2,300]newvalue = Replace(oldvalue,softwareOld,softwareNew)[/glow]
Call currentDoc.ReplaceItemValue(FIELD_NAME$,newvalue)

--- Ende Code ---
In der markierten Zeile steigt mir Notes mit einem NSD aus.  >:(

oldvalue und newvalue sind beide als Variant deklariert, Option Declare ist an...

Ich verstehe es nicht...  ???

m3:
Crash or 'Type Mismatch' error when LotusScript Replace function is called


--- Zitat ---These issue occur in cases where one of the parameters was initially declared as a Variant and then was changed to a String array using the Redim statement.
--- Ende Zitat ---

Nachtrag:
LotusScript Replace Function Crashes/hangs 6.x Notes Client or Domino Server if Called From Other Function or Subroutine


--- Zitat ---A LotusScript agent which passes arrays via a function or subroutine call to the Replace function will cause a crash or hang. The issue does not occur if one does not pass arrays.
--- Ende Zitat ---

botschi:
Nimm doch mal ArrayReplace

MadMetzger:

--- Zitat von: m3 am 07.12.06 - 16:59:59 ---Crash or 'Type Mismatch' error when LotusScript Replace function is called


--- Zitat ---These issue occur in cases where one of the parameters was initially declared as a Variant and then was changed to a String array using the Redim statement.
--- Ende Zitat ---

--- Ende Zitat ---
Das scheint in etwa zu passen. Ich habe dann nach botschis Tipp einfach das Replace durch ein ArrayReplace ersetzt und jetzt läuft es durch!

Vielen Dank für die schnelle Hilfe!

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln