Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
GandK-Geoff
Visitor

Re: passing data to functions and subs

"jbrave" wrote:
I'm really working hard on an app, but I don't just want to "get it done" I want to understand what I'm doing. Mostly I worry that I'm going to annoy people by asking so many questions, hopefully not.


We like it when people want to actually understand, rather than just be spoon-fed finished code. Don't worry, honest desire to learn isn't annoying unless you're unwilling to crack a manual -- and I've seen no evidence of that yet. 🙂
0 Kudos
jbrave
Channel Surfer

Re: passing data to functions and subs

Thanks G+K!

One more question on the m. thing:

is there any reason not to use m. for _all_ my variables? Seems like it will simplify everything for me to just prefix and relate to all variables arrays etc with m. Will that bite me later on?

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

Re: passing data to functions and subs

I wouldn't "always" use m. in front of all your variables.... You just need to be aware of the context of your variables.

1) In the global scope: The default "object" scope for all methods not explicitly in any other object scope
2) Within an object, or an associative array, "m." refers to names within the associative array of the object
3) Local variables within a function do not have an m. or another object name qualifier in front of the name
4) Parameters to functions do not have an "m." in front of the name.

--Kevin
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.