
Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2015
01:01 PM
Jan 13 update - Nice Debug console improvements - "count"?
I just wanted to say that I already like the debug console improvements with better information from a crash.
Question - what is "count" after "refcnt"?
Example, two lines for me say:
PS - my code seems a bit faster - for instance, one startup timer I noticed now takes 19ms every time, whereas it used to take usually 21-22ms in previous days. If that's improved everywhere, nice work, and extra 5-10% is welcome 🙂
Question - what is "count" after "refcnt"?
Example, two lines for me say:
sy roAssociativeArray refcnt=4 count:12
id roArray refcnt=2 count:1
PS - my code seems a bit faster - for instance, one startup timer I noticed now takes 19ms every time, whereas it used to take usually 21-22ms in previous days. If that's improved everywhere, nice work, and extra 5-10% is welcome 🙂
9 REPLIES 9

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2015
01:09 PM
Re: Jan 13 update - Nice Debug console improvements - "count
count is the number of items in the container. It's printed for roArray, roAssociativeArray and roList.
--Mark
--Mark

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2015
01:12 PM
Re: Jan 13 update - Nice Debug console improvements - "count
Ah, I see, my sy Associative Array has 12 key/value pairs inside, yes.
Can we count AA's? I only saw .Count() documented for Arrays, not AA's.
Can we count AA's? I only saw .Count() documented for Arrays, not AA's.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2015
09:05 PM
Re: Jan 13 update - Nice Debug console improvements - "count
Best debug console update is the fact that it doesn't exit the channel when you break into it now!
"Komag" wrote:.Count() is available for AAs now. Indexers are also available (i.e., AA[1])
Can we count AA's?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2015
02:51 AM
Re: Jan 13 update - Nice Debug console improvements - "count
Does that mean they're no longer "random"? Alphabetical? How can we reasonably make use of indexers

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2015
10:43 AM
Re: Jan 13 update - Nice Debug console improvements - "count
"Komag" wrote:
Does that mean they're no longer "random"? Alphabetical? How can we reasonably make use of indexers
They've never been "random" as the keys are always enumerated in the same order (no idea what that order is). I have no idea how you'd use indexers... I just noticed it by accident while debugging something the other day.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2015
03:38 PM
Re: Jan 13 update - Nice Debug console improvements - "count
"TheEndless" wrote:Peace and blessings be upon them, indeed! --Charlie
Best debug console update is the fact that it doesn't exit the channel when you break into it now!
"Komag" wrote:Unofficially it has been in a beta for couple of months, see viewtopic.php?f=34&t=75809&p=463321#p462756
Can we count AA's?
It was documented yesterday in ifAssociativeArray
"TheEndless" wrote:Hmmm. What firmware would that be that you are talking about? Does not work on 6.1.5518:
Indexers are also available (i.e., AA[1])
BrightScript Debugger> a = {a:1, b:2}
BrightScript Debugger> ? a[0]
Type Mismatch. (runtime error &h18) in $LIVECOMPILE(482)
"TheEndless" wrote:"Komag" wrote:
Does that mean they're no longer "random"? Alphabetical? How can we reasonably make use of indexers
They've never been "random" as the keys are always enumerated in the same order (no idea what that order is). I have no idea how you'd use indexers... I just noticed it by accident while debugging something the other day.
Ummmm, not quite. The enumeration order of hash/dictionary traditionally is pseudo-random but is not guaranteed to remain the same. What is guaranteed is that enumeration will go through all elements (in some arbitrary order - and in some implementations on condition the AA is not modified during the enumeration). I doubt RokuCo would like to codify that enumeration is in the same order. I also have serious doubts about usefulness of what you call "indexers" but looking forward to hear more

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2015
05:38 PM
Re: Jan 13 update - Nice Debug console improvements - "count
"EnTerr" wrote:
Hmmm. What firmware would that be that you are talking about? Does not work on 6.1.5518:
I'll need to double check, but I'm pretty sure it was 6.1.something.
"EnTerr" wrote:
I also have serious doubts about usefulness of what you call "indexers" but looking forward to hear more
I can't think of a worthwhile use for them either, but the fact that it worked caused me a bit of headache tracking down what would have previously caused a crash.
I used "indexer" in the C# sense. What would you call them?
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2015
11:18 AM
Re: Jan 13 update - Nice Debug console improvements - "count
"TheEndless" wrote:"EnTerr" wrote:
... what you call "indexers" but looking forward to hear more
... I used "indexer" in the C# sense. What would you call them?
Umm... i would have said "[ ] operator", i suppose. Or "index accessor". A mouthful, i know. I did not know they named it "indexer" in C# world. But now that i heard it, i like it - it's shorter.
What confused me is that you used the term in particular way, implying only numerical indexing:
"TheEndless" wrote:But this is also an "indexer" - A["foo"]. The use of [ ] is, as we know, the AA's bread and butter.
Count() is available for AAs now. Indexers are also available (i.e., AA[1])
The behavior you mention - if i got it right - was something like "ordinal indexing" (i.e. looking up value in AA by a number in some arbitrary order lineup). I wondering if there is some twisted way to get that by forcing particular interface call but come with nothing.
Side bar: this btw is different from allowing non-string keys in an AA. In some other languages one can do things like - example in Python:
>>> hash = {'a': 1, 1: True, False: [1], (1e9, 'foo'): {} }So it seems almost anything can be used as key there, also do mix&match. But not quite everything - only immutable objects are allowed: strings, numbers, tuples (but no lists), frozen-sets (but no sets or dictionaries). It can be useful but questionable due to complications (both as implementation and use).
>>> hash
{'a': 1, 1: True, (1000000000.0, 'foo'): {}, False: [1]}
>>> hash['a']
1
>>> hash[1]
True
>>> hash[1e9, 'foo']
{}
brookharry12
Newbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023
10:46 PM
Re: Jan 13 update - Nice Debug console improvements - "count"?
The count represents the total number of items present in the container. It is displayed for roArray, roAssociativeArray, and roList.