Evaluating an Empty List

Date:    Wed, 23 Aug 1995 22:25:54 EDT
From:    John Dowdell <71333.42@COMPUSERVE.COM>
Subject: Re: DFW: Evaluating an Empty List
Peter Fleck writes on 8/22 of intermittent results with use of a test such as:
   >>  if someList <> EMPTY then DoStuff

The Lingo keyword "EMPTY" refers to empty strings, but a list is a different datatype... you can check whethere "count(someList) <> 0", or whether "someList = []".

Lists are faster than strings. Strings have to be evaluated character by character. In a list each element is knocked into a fast table... easier to process, takes less time, has more manipulations (or perhaps different manipulations) available to it.

Regards, John Dowdell
Macromedia Tech Support


Date:    Thu, 24 Aug 1995 15:28:06 +0100
From:    Andreas Viviani 
Subject: Re: DFW: Evaluating an Empty List
I would do it the secure way without magic:
if objectP(aListToTestIfEmpty) then
  if count(aListToTestIfEmpty) then
    alert "Your list is NOT empty."
  else
    alert "Your list is empty."
  end if
else
  alert "Your list does not exist at all."
end if