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?
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?
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.