: 4581 | 108544 | 12346

Function to test for an empty List (LS) 
New idea submissions, commenting and voting are no longer available on this site. Logins have also been disabled.
Use this IdeaSpace to post ideas about Domino Designer.

: 114
: 116
: 2
: Domino Designer
: lotusscript, designer
: Stan Rogers1150 13 Dec 2007
:
: / Email
There ought to be a better way of checking for an empty List than checking for a no-op Forall or trapping error 120. Perhaps extending IsEmpty to cover? I'd find that particularly helpful with class coding, when I'd often like to defer populating a List member until the first call to a method that uses it.



1) Slawek Rogulski8874 (13 Dec 2007)
Absolutely!
2) Charles Robinson5461 (13 Dec 2007)
This has driven me nuts for a very long time.
3) Michael Sobczak2969 (31 Dec 2007)
We're talking about arrays, then? Definitely. I hate having to maintain a separate index variable and check it for 0 or -1 to see if the array is empty or not.
4) Thomas Kennedy85 (07 Jan 2008)
Michael, I always, always put arrays inside a collection object, with add and remove methods and a public integer property Count. It simplifies enormously dealing with arrays.
5) Jim Fricker43 (29 Jul 2008)
I think Stan is referring to a list, not an array, and a collection can only hold documents, a list can hold anything. eg Dim myList List as Variant
6) Erik Brooks795 (05 Mar 2010)
Here you go:

Function IsListEmpty (ListStuff As Variant) As Integer

isListEmpty = True

Forall stuff In ListStuff
If Listtag(stuff) = "" Then
isListEmpty = True
Exit Function
Else
isListEmpty = False
Exit Function
End If
End Forall

End Function
7) Kenneth Axi1694 (03 Aug 2011)
@6 Erik: Yes, but that should be included directly into LotusScript and You shouldn't have to construct Your own function for it. I think that the function IsEmpty() definitly should be expanded to be used for Lists as well.










:
:




Welcome to IdeaJam™


You can run IdeaJam™ in your company. It's easy to install, setup and customize. Your employees, partners and customers will immediately see results.

Use IdeaJam to:

  • Collect ideas from employees
  • Solicit feedback and suggestions from employees and customers
  • Run innovation contests and competitions
  • Validate concepts
  • Use the power of "crowd-sourcing" to rank ideas and allow the best ideas to rise to the top

IdeaJam™ works with:

  • IBM Connections
  • IBM Lotus Quickr
  • Blogs and Wikis
  • Websphere Portal
  • Microsoft Sharepoint
  • and other applications.

IdeaJam has an extensive set of widgets and API's that allow you to extend and integrate IdeaJam™ with other applications.

Learn more about IdeaJam >>






IdeaJam developed by

Elguji Software Logo