Domino 9 und frühere Versionen > ND8: Entwicklung
Wie Liste auf Vorhandensein von Listenelementen prüfen?
BigWim:
Hast Du es schon mal mit IsList und IsElement probiert?
Mit Listen habe ich persönlich (noch) nicht viel Erfahrung. Das habe ich in der Hilfe gefunden.
--- Zitat ---IsList( listName ) returns True (-1) or False (0) depending on whether listName is a list.
--- Ende Zitat ---
--- Zitat ---IsElement( listName ( stringExpr )) returns True (-1) or False (0) depending on whether stringExpr is a list tag in listName. There are a variety of circumstances under which you might want to test for the existence of a particular list tag in a list. Two cases are:
You want to add a new element to a list and want to make sure that the list tag you plan to use isn’t already in use (because if it is, and you used it in an assignment statement, you would overwrite the element that it identifies).
You want to refer to an element and want to make sure that the element exists before doing so (because if you refer to a nonexistent list tag, LotusScript returns an error).
--- Ende Zitat ---
Werner Götz:
Vielleicht hilft das weiter?
--- Code: ---Function HasElements(lst As Variant) As Boolean
Forall e In lst
HasElements = True
Exit Function
End Forall
HasElements = False
End Function
--- Ende Code ---
-Werner
DAU-in:
IsList gibt true zurück, weil die Variable als Liste definiert ist.
Das Abfragen der Listtags bringt auch nichts, weil die erst definiert werden, wenn ein Unterschied besteht.
DAU-in:
--- Zitat von: Werner Götz am 20.04.09 - 11:34:00 ---Vielleicht hilft das weiter?
--- Code: ---Function HasElements(lst As Variant) As Boolean
Forall e In lst
HasElements = True
Exit Function
End Forall
HasElements = False
End Function
--- Ende Code ---
-Werner
--- Ende Zitat ---
Die Firma dankt.
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln