Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jbrave
Level 8

Function References - documentation?

Seems to be zero docs on these things:

this.addParams = oauth_add_params

where oauth_add_params is the same name as a function:

Function oauth_add_params(http As Object) As Void

Anyone want to elaborate on how these things work? Is it the underscore that makes it key to the function? Or do we have to be careful not to have variables with the same name as the function?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
3 REPLIES 3\
jbrave
Level 8

Re: Function References - documentation?

Ok, no responses?

Well let me rephrase it then: What are the rules for using function references, which are undocumented, for the most part, in the Brightscript manual, but are *heavily* used in the examples?

Anyone who's used them care to comment? Of course, from the examples, it looks easy enough, right, but I really don't like working in the dark. Anyone care to shine a light?


- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Level 10

Re: Function References - documentation?

There's no magic to the name of the function. You can specify any function as a method of an "object" in BrightScript. This actually harkens back to the m. scope discussion we had awhile back. In the case of a function reference like this, the "m." object references the object the method is defined on, instead of the global "m.".

It's similar to prototyping in javascript, if that helps.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
RokuKevin
Level 9

Re: Function References - documentation?

It's the type value in the name/value pair that makes it a method or a parameter. If the value type is a function it becomes an object method.

--Kevin.
0 Kudos