jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2011
12:24 AM
Associative Array for error codes...
would be nice to be able to do something like this:
{500:"internal Server Error",501:"not implemented"}
just for example, so one could quickly build a table of codes to return value from.
Any suggestions, am I missing something here? I would hate to have to write a massive set of if/then's to do something like this.
- Joel
{500:"internal Server Error",501:"not implemented"}
just for example, so one could quickly build a table of codes to return value from.
Any suggestions, am I missing something here? I would hate to have to write a massive set of if/then's to do something like this.
- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
3 REPLIES 3
renojim
Community Streaming Expert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2011
02:11 AM
Re: Associative Array for error codes...
You can always do this:
Another option would be to build your table with a leading character:
-JT
codes = {}then
codes.AddReplace("500","internal Server Error")
codes.AddReplace("501","not implemented")
error = SomeFunction() ' returns an Integer
?codes[error.toStr()]
Another option would be to build your table with a leading character:
codes = {x500:"internal Server Error",x501:"not implemented"}then use:
?codes["x"+error.toStr()]
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2011
07:52 AM
Re: Associative Array for error codes...
Not sure if this is what you were asking, but see this post for a list of error codes. This will be provided as a public AA in a future release.
--Mark
--Mark
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2011
04:27 PM
Re: Associative Array for error codes...
Thanks, I was really looking for the method as opposed to the codes, I used http codes as the example, but this is for a completely different set of codes.
-Joel
-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!