pmpascua
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
07:03 AM
How to specify a function to return as array?
Hello, New Roku guy here.
I want to know how to specify a function to return an array. Not associated array, an Array. It seems obvious but defining it like this doesn't seem to work.
I looked around but I haven't found an existing problem within the internet
I want to know how to specify a function to return an array. Not associated array, an Array. It seems obvious but defining it like this doesn't seem to work.
function Foo() as Array
return []
end function
I looked around but I haven't found an existing problem within the internet
6 REPLIES 6

squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
07:19 AM
Re: How to specify a function to return as array?
I want to know how to specify a function to return an array. Not associated array, an Array. It seems obvious but defining it like this doesn't seem to work.
function Foo() as Array
return []
end function
bar = Foo()
function Foo() as Array
bar = [0,1]
return bar
end function
Kinetics Screensavers
pmpascua
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
01:01 PM
Re: How to specify a function to return as array?
You basically wrote the same thing I did. The problem here is that the 'Array' part is treated as syntax array on eclipse.
pmpascua
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
01:07 PM
Re: How to specify a function to return as array?
Never mind, I found out through the syntax error that 'Array' is not a valid token
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
01:47 PM
Re: How to specify a function to return as array?
bar = Foo()
function Foo() as Object
bar = [0,1]
return bar
end function

Komag
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
02:38 PM
Re: How to specify a function to return as array?
As far as I know you can't specify an Array, only Object
You can have:
Integer
Float
String
Boolean
Object (a catchall for Roku objects such as Array, Associative Array, other?)
You can have:
Integer
Float
String
Boolean
Object (a catchall for Roku objects such as Array, Associative Array, other?)
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2016
03:53 PM
Re: How to specify a function to return as array?
"Komag" wrote:
Object (a catchall for Roku objects such as Array, Associative Array, other?)
Yes. Object captures all things "ro-". [ ] and { } are roArray and roAssociativeArray, respectively.
You can see the full list of types at Expressions, Variables, and Types (Oh my!)