Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
matrixebiz
Roku Guru

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 2
RokuMarkn
Visitor

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
Roku Guru

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
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.