Developers

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
georgejecook
Streaming Star

CallFunc and return values - is this a bad idea?

I copied this from the slack group (why aren't you on there yet? 😉  https://join.slack.com/t/rokudevelopers ... 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 ... >
<interface>
<func name="SayHello">....

'then.. in the brs file
function SayHello(name) as string
 return "Hello " + name
end function```
(edited)
and much to my surprise
I can do this
```a = CreateNode("roSGNode","MyUtils")
? a.SayHello("George")
>>> "Hello George"```
(edited)
!!!!
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
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
Tags (1)
0 Kudos
1 REPLY 1
gomad
Roku Guru

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! 🙂
Tags (1)
0 Kudos
Community is Temporarily in Read-Only Mode!

We’re upgrading Roku Community to bring you a faster, more mobile-friendly experience. You may notice limited functionality or read-only access during this time. You will not be able to log in or post new comments or kudos during this time. Read more here.

Planned Downtime:
Community will be unavailable for up to 24–48 hours during the upgrade window during the week of May 12 and you may notice reduced functionality. In the meantime, for additional assistance, visit our Support Site.

Thanks for your patience — we’re excited to share what’s next!