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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 8

CallFunc and return values - is this a bad idea?

I copied this from the slack group (why aren't you on there yet? 😉 ... mUxOTdlNTE

I’m trying to come up with something nicer than always importing the same things into my scenegraph files

now.. that’s not such a drag; coz I have baseclasses
but still, it seems wasteful
I’m wondering about a TASK based pattern
coz I recently found I can do this
```<MyUtils extends="ContentNode ... >
<func name="SayHello">....

'then.. in the brs file
function SayHello(name) as string
 return "Hello " + name
end function```
and much to my surprise
I can do this
```a = CreateNode("roSGNode","MyUtils")
? a.SayHello("George")
>>> "Hello George"```
which.. _theoretically_ could mean that I could put a load of stuff I use commonly, like rodash/some utils/etc, inside a long running utils task
and call it willy nilly..
but I wanted to know what the ramifications are for that
unfortunately, roku engineering were too busy to answer that question at the time
but perhaps someone here can tell me if that’s a *really really bad* idea or a *really really good* one?
George Cook
Roku developers slack group ( : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
Level 10

Re: CallFunc and return values - is this a bad idea?

i am doing it. So far so good, and hoping it to continue working that way! 🙂
0 Kudos