: 4582 | 108638 | 12353

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 Robinson5466 (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 >>


0
Use more customization features in ND9 NotesMail
13
Two-week Calendar view
3
@Formula library
25
Drafts - unsent count?
2
New Hide-When property
3
Activity Logging for Quickr
5
"follow-up complete" flag
15
Remake Resource Reservation template using XPage
6
Boolean operators on LDAP group based access control
17
Store IP Address / remote host data in Password Lockout documents
18
Checking Out-Of-Office status of others
7
DocumentCollection.search(@formula)
23
Tool to show unreferenced design elements for easy cleaup
5
Bring sametime audio and video into the web browser using WebRTC
17
"Window Title" for views
17
QuickR application/widgets for Android/iPhone
21
Create Computed Text with the same text style as the current paragraph
9
@Function and LotusScript to "View..Customize This View" dialog
8
Extend the 'User detail' info of a database
17
Print of calendar in color
6
Shared Actions belong under Shared Elements
20
Facelift all web enabled templates with xPages
3
Please extend WebDAV to include calDAV & cardDAV support for contacts/calendar syncing
2
Skin-ing Notes Design elemens
14
Add some views into the "Views" section of the Notes 8.5 mailbox






IdeaJam developed by

Elguji Software Logo