Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
matrixebiz
Level 7

Printing an Array

Hello, when I print the output of an invalid IDArray I get this;
<Component: roArray> =

[
    ""
]

The good IDArray gives me;
<Component: roArray> =

[
    "WorkingProperly"
]

How do I make an "IF" statement out of that invalid result? 
I tried  if IDArray = [""] then ....  but get an error of "Type Mismatch. (runtime error &h18) in pkg:/source/RokuFeed.brs(350)" Thx
0 Kudos
2 Replies
RokuMarkn
Level 7

Re: Printing an Array

As I told you a couple of weeks ago in this thread, your getStreamId function was unconditionally adding an empty string to the array, even when it failed, which didn't seem right to me.  You've since deleted the code from that post so no one can see what it's doing.  But as I said there, you need to decide if you really want the error case to return an array containing one element, or an empty array.  If you really want it to contain one element (which seems strange to me and likely to cause other problems later, but that's your choice), then the way to test it would be:

if IDArray.count() = 1 and IDArray[0] = ""


--Mark
0 Kudos
matrixebiz
Level 7

Re: Printing an Array

Hi Mark, my other thread I got too confused on the direction I want to go but what you have showed me above is what I needed. Thank you
0 Kudos