Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: MadMetzger am 07.12.06 - 16:54:16

Titel: NSD bei Replace in Agent
Beitrag von: MadMetzger am 07.12.06 - 16:54:16
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)
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...  ???
Titel: Re: NSD bei Replace in Agent
Beitrag von: m3 am 07.12.06 - 16:59:59
Crash or 'Type Mismatch' error when LotusScript Replace function is called (http://www.ibm.com/support/docview.wss?rs=899&context=SSKTWP&dc=DB510&dc=DB520&dc=D800&dc=D900&dc=DA900&dc=DA800&dc=DB530&dc=DA600&dc=D600&dc=D700&dc=DA500&dc=D200&dc=DA410&dc=DA450&dc=DA430&dc=DA440&dc=DB540&dc=DB400&dc=DA420&dc=DA460&dc=DB300&dc=DA470&dc=DA480&dc=DB100&dc=DA4A10&dc=DA4A20&dc=DA700&dc=DA4A30&dc=DB550&dc=D100&q1=Replace+Lotus+script&uid=swg21231699&loc=en_US&cs=UTF-8&lang=all)

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.

Nachtrag:
LotusScript Replace Function Crashes/hangs 6.x Notes Client or Domino Server if Called From Other Function or Subroutine (http://www.ibm.com/support/docview.wss?rs=899&context=SSKTWP&dc=DB510&dc=DB520&dc=D800&dc=D900&dc=DA900&dc=DA800&dc=DB530&dc=DA600&dc=D600&dc=D700&dc=DA500&dc=D200&dc=DA410&dc=DA450&dc=DA430&dc=DA440&dc=DB540&dc=DB400&dc=DA420&dc=DA460&dc=DB300&dc=DA470&dc=DA480&dc=DB100&dc=DA4A10&dc=DA4A20&dc=DA700&dc=DA4A30&dc=DB550&dc=D100&q1=Replace+Lotus+script&uid=swg21109669&loc=en_US&cs=UTF-8&lang=all)

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.
Titel: Re: NSD bei Replace in Agent
Beitrag von: botschi am 07.12.06 - 17:00:57
Nimm doch mal ArrayReplace
Titel: Re: NSD bei Replace in Agent
Beitrag von: MadMetzger am 07.12.06 - 17:23:22
Crash or 'Type Mismatch' error when LotusScript Replace function is called (http://www.ibm.com/support/docview.wss?rs=899&context=SSKTWP&dc=DB510&dc=DB520&dc=D800&dc=D900&dc=DA900&dc=DA800&dc=DB530&dc=DA600&dc=D600&dc=D700&dc=DA500&dc=D200&dc=DA410&dc=DA450&dc=DA430&dc=DA440&dc=DB540&dc=DB400&dc=DA420&dc=DA460&dc=DB300&dc=DA470&dc=DA480&dc=DB100&dc=DA4A10&dc=DA4A20&dc=DA700&dc=DA4A30&dc=DB550&dc=D100&q1=Replace+Lotus+script&uid=swg21231699&loc=en_US&cs=UTF-8&lang=all)

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.
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!