EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014
04:56 PM
Is doco wrong on ifEnum.isEmpty() ?
I am confused about isEmpty() on enumerables. RTFM implies isEmpty() is the opposite of isNext():
But the two do not stay in sync:
Seems that (and i am hoping that) the actual meaning is: isEmpty() returns whether the object has no elements (regardless of where next pointer currently is).
Is this correct? I am asking for realz, got a list - want to check if it is empty and o.isEmpty() sounds as a better/properer way than checking o.count() = 0.
"ifEnum" wrote:
...
IsNext() as Boolean
Returns true if there is a next element
IsEmpty() as Boolean
Returns true if there is not a next element
But the two do not stay in sync:
BrightScript Debugger> a = [1]
BrightScript Debugger> ? a.isEmpty(), a.isNext()
false true
BrightScript Debugger> ? a.next()
1
BrightScript Debugger> ? a.isEmpty(), a.isNext()
false false
Seems that (and i am hoping that) the actual meaning is: isEmpty() returns whether the object has no elements (regardless of where next pointer currently is).
Is this correct? I am asking for realz, got a list - want to check if it is empty and o.isEmpty() sounds as a better/properer way than checking o.count() = 0.
2 REPLIES 2

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014
05:36 PM
Re: Is doco wrong on ifEnum.isEmpty() ?
You are correct. I've updated the doc.
--Mark
--Mark
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014
05:47 PM
Re: Is doco wrong on ifEnum.isEmpty() ?
Much obliged!