Domino 9 und frühere Versionen > ND6: Entwicklung

Function requires a valid ADT argument

(1/5) > >>

JanHoener:
hallo zusammen.
ich habe folgendes Script:
Sub Initialize
   Dim s As New notessession
   Dim db As notesdatabase
   Dim col As notesdocumentcollection
   Dim docLoop As notesdocument
   Dim docWork As notesdocument
   Set db=s.currentdatabase
   Set col=db.alldocuments
   Set doc=col.getfirstdocument
   While Not doc Is Nothing
      Set docWork=docLoop
      Set docLoop=col.getnextdocument(docWork)
      If docWork.form(0)={Album} Then
         docWork.AltInterpretSort=Metaphon(docWork.Interpret(0))
         Call docWork.save(True,True)
      End If
   Wend
End Sub

Dies ist angepasst und von http://www.sns1.de/partner/flamme/wflamme.nsf/Shortcut/Klangfarben?OpenDocument&ExpandSection=2#_Section2 übernommen.
Meine Anpassungen: ich möchte auf die Maske "Album" zugreifen, das zu Prüfende Feld heißt "Interpret" und geschrieben wird in das Feld "AltInterpretSort".

Was mache ich falsch?

Marinero Atlántico:
Kein Errorhandling.
Dann könntest du nämlich sehen in welcher Zeile dieser Fehler auftritt:
Probier das mal:

--- Code: ---Sub Initialize
on Error goto ABJETZTBENUTZEICHIMMERERRORHANDLING
   Dim s As New notessession
   Dim db As notesdatabase
   Dim col As notesdocumentcollection
   Dim docLoop As notesdocument
   Dim docWork As notesdocument
   Set db=s.currentdatabase
   Set col=db.alldocuments
   Set doc=col.getfirstdocument
   While Not doc Is Nothing
      Set docWork=docLoop
      Set docLoop=col.getnextdocument(docWork)
      If docWork.form(0)={Album} Then
         docWork.AltInterpretSort=Metaphon(docWork.Interpret(0))
         Call docWork.save(True,True)
      End If
   Wend
exit sub
ABJETZTBENUTZEICHIMMERERRORHANDLING:
print |Fehler in --Name-- | & Error$ & "(" & Cstr(Err) & ") in Zeile:" & Cstr(Erl)
exit sub
End Sub
--- Ende Code ---

JanHoener:
er sagt mir fehler in zeile 13...und nun?

TMC:
docLoop ist hier wohl "Nothing".
Die doc - Variable hast Du gar nicht deklariert.

Auf den ersten Blick musst Du mal Deine Variablen-Bezeichnungen checken.

koehlerbv:
Und mit Option Declare wäre das nicht passiert ...

Navigation

[0] Themen-Index

[#] Nächste Seite

Zur normalen Ansicht wechseln