BrightScript Debugger> rXL = createObject("roXmlList")
BrightScript Debugger> rXL.push("something")
BrightScript Debugger> ? type(rXL), rXL.count(), rXL[0]
roXMLList 1 something
BrightScript Debugger> ? getInterface(rXL, "ifArray")
<Interface: ifArray>
"EnTerr" wrote:
The significance is that array operations can be used to go over a roXmlList - and notably, .count().
"TheEndless" wrote:
.Count() is an ifList method.
BrightScript Debugger> ? rXL.count()
1
BrightScript Debugger> ? rXL.ifList.count()
0
BrightScript Debugger> ? rXL.ifArray.count()
0
"EnTerr" wrote:"TheEndless" wrote:
.Count() is an ifList method.
Hm, yeah - .count() is a method of both ifList and ifArray, good catch. But check this out - seems when you use count() on roXmlList, it's neither ifList's nor ifArray's:BrightScript Debugger> ? rXL.count()
1
BrightScript Debugger> ? rXL.ifList.count()
0
BrightScript Debugger> ? rXL.ifArray.count()
0
Huuuh? :shock:
specifying the interface with the dot operator is optional. If it is left out ,... , each interface in the object is searched for the member function. If there is a conflict (a member function with the same name appearing in two interfaces), then the interface should be specified.
"belltown" wrote:
From the BrightScript Language Reference:specifying the interface with the dot operator is optional. If it is left out ,... , each interface in the object is searched for the member function. If there is a conflict (a member function with the same name appearing in two interfaces), then the interface should be specified.
"EnTerr" wrote:
Hm, yeah - .count() is a method of both ifList and ifArray, good catch. But check this out - seems when you use count() on roXmlList, it's neither ifList's nor ifArray's:BrightScript Debugger> ? rXL.count()
1
BrightScript Debugger> ? rXL.ifList.count()
0
BrightScript Debugger> ? rXL.ifArray.count()
0
3.7.2 Dot Operator
The dot operator can be used on any BrightScript Component. It also has special meaning when used on any roAssociativeArray, roXMLElement or roXMLList.
...
See the section on XML support for details on using the dot operator on xml objects.
4.5 BrightScript XML Support
...
Dot Operator
1.When applied to an roXMLElement, the dot operator returns an roXMLList of children that match the dot operand. If no tags match, an empty list is returned.
2.When applied to an roXMLList, the dot operator aggregates the results of performing the dot operator on each roXMLElement in the list.
...
BrightScript Debugger> xml = CreateObject("roXMLElement")
BrightScript Debugger> xml.Parse("<a> <ifArray>1</ifArray> <ifList>b</ifList> <ifArray>2</ifArray> <ifArray>3</ifArray> </a>")
BrightScript Debugger> ? xml.ifArray.Count()
3
BrightScript Debugger> ? xml.ifList.Count()
1
"RokuKC" wrote:"EnTerr" wrote:
Hm, yeah - .count() is a method of both ifList and ifArray, good catch. But check this out - seems when you use count() on roXmlList, it's neither ifList's nor ifArray's:BrightScript Debugger> ? rXL.count()
1
BrightScript Debugger> ? rXL.ifList.count()
0
BrightScript Debugger> ? rXL.ifArray.count()
0
This isn't calling rXL interface methods, but instead returning the list of its children with those names.
"3.7.2 Dot Operator" wrote:
...
When used on a BrightScript Component, it refers to an interface or a member function.
Examplei = CreateObject("roInt")
i.ifInt.SetInt(5)
i.SetInt(5)
"ifInt" is the interface, and "SetInt" is the member function. Every member function of a BrightScript Component is part of an interface. However, specifying the interface with the dot operator is optional. If it is left out, as in the last line of the example above, each interface in the object is searched for the member function. If there is a conflict (a member function with the same name appearing in two interfaces), then the interface should be specified.
"belltown" wrote:
It's the mystery, undocumented Count().
Isn't it just a little annoying that the Roku docs don't tell the whole picture?
Speaking of undocumented features, I just found out a few minutes ago that roAudioPlayer supports live streaming AAC audio. For years, the documentation has been adamant that it only supports WMA and MP3.
"destruk" wrote:"belltown" wrote:
It's the mystery, undocumented Count().
Isn't it just a little annoying that the Roku docs don't tell the whole picture?
Speaking of undocumented features, I just found out a few minutes ago that roAudioPlayer supports live streaming AAC audio. For years, the documentation has been adamant that it only supports WMA and MP3.
" The component understands the following streamformat values: "mp3", "wma", "mp4", "hls", "es.aac-adts", "flac""
http://sdkdocs.roku.com/display/sdkdoc/roAudioPlayer
It's been updated