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
Tags (1)
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
Tags (1)
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
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!