Forum Discussion
- RokuMarknVisitorroAssociativeArray supports the ifEnum interface, so you can just say
for each key in aa ...
Several of the examples have a PrintAA function that will print an AssociativeArray using this technique.
--Mark - EnTerrRoku Guru"print" comes to mind :). Seriously though, the print output has improved recently (7.1). Cue:
BrightScript Debugger> ? config
<Component: roAssociativeArray> =
{
init1: 5
init2: 1332175218
name: Kuro%.2s%s
origin: http://localhost
servers: <Component: roArray>
}
When i want to see the nested data, i'd use "? formatJSON(...)" - squirreltownRoku Guru
"EnTerr" wrote:
"print" comes to mind :). Seriously though, the print output has improved recently (7.1).
I noticed that. I was like "why is it printing that array?"EnTerr" wrote:
When i want to see the nested data, i'd use "? formatJSON(...)"
Great idea. Thanks - pcnwebChannel SurferSecondary question: How do I print an associative array in this scenario?
<Component: roArray> =
[
<Component: roAssociativeArray>
] - pcnwebChannel SurferI should pay more attention the answers:
? formatJSON(myVariable)
Does the job, thanks all! - EnTerrRoku Guru
"pcnweb" wrote:
Secondary question: How do I print an associative array in this scenario?<Component: roArray> =
[
<Component: roAssociativeArray>
]
Yep, serializing to JSON will do it if bearable enough to watch. Or looking at the above, you got yourself an "array of dictionaries" [{}], so to see what's inside, have to peel the top level first, e.g. "? myVar[0]" will print you the top level of the AA. I know, can be confusing - but at least now PRINT mentions the type and shows the [ ] or { } brackets, before if i remember it would just dump the content. BEFORE it was something like:BrightScript Debugger> ? [ { } ]
<Component: roAssociativeArray>
Related Content
- 12 years ago
- 11 years ago