Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
EnTerr
Level 9

objFun() = no fun

I was trying to figure out how to use objfun - my understanding is that - given object interface, method name and parameters - it will call said method and return the result. Except i have no luck pleasing it, it seems to insist on at least 3 arguments (object + interface + method_name?) but even then says "member function not found".

So far the only thing i discovered is YAWRR (Yet Another Way to Reboot Roku):
BrightScript Debugger> ? objfun([], "", "")
Connection closed by foreign host.
Should've made career in test engineering, for things seem to fall apart in my hands w/o even trying.
0 Kudos
8 Replies
TheEndless
Level 7

Re: objFun() = no fun

What the heck is objFun(), and how in the world do you find these obscure things?
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
kc8pql
Level 7

Re: objFun() = no fun

^ I was wondering about that myself...
____________________________________________________________________________________________________________
No, I don't work for Roku.
Netflix Player N1000X, XDS 2100X (premature death by lightning)
Roku2 XD 3050X, Roku2 XS 3100R, Roku2 4210R
0 Kudos
EnTerr
Level 9

Re: objFun() = no fun

"TheEndless" wrote:
What the heck is objFun(), and how in the world do you find these obscure things?

Why, by reading some apocryphal bright-scriptures. That's where i learnt about the constant global and ifGlobal too. Not everything has made it into the canon. ObjFun is related to GetInterface and you can see it as a reserved word... if someone had bothered to include the list of reserved words in the wiki!

By the way, i came with this idea of a game/challenge: "YAWRR Code Golf". It's a code golf, where the goal is to write the shortest code that forces Roku player to reboot. I submit my entry from above - only 16 characters, can someone best that? (Benefit for RokuCo in this code golf is they could patch the issues found, if they see fit)
0 Kudos
TheEndless
Level 7

Re: objFun() = no fun

"EnTerr" wrote:
Why, by reading some apocryphal bright-scriptures.

Ahh.. the legacy BrightSign documentation.. gotcha.

"EnTerr" wrote:
I submit my entry from above - only 16 characters

I can't get that to crash mine. :?
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
Highlighted
EnTerr
Level 9

Re: objFun() = no fun

"TheEndless" wrote:
"EnTerr" wrote:
I submit my entry from above - only 16 characters

I can't get that to crash mine. :?

Doh!
Do you by any chance live by Lake Wobegon ("where all the women are strong, all the men are good looking, and all the children are above average")?
For me it worked reliable on Roku 2xxx, 3xxx, 4xxx (fw 3 and 5, tested from console).

The runner-up for YAWRR CodeGolf i know is 24 chars but discovered by you.
0 Kudos
gcolin59
Level 7

Re: objFun() = no fun

di = createObject("roDeviceInfo")
iface = getInterface(di, "ifDeviceInfo")
print objFun(di, iface, "getModel")

Will do the same thing as:
print di.ifDeviceInfo.getModel()
0 Kudos
georgejecook
Level 7

Re: objFun() = no fun

why not use callfunc ? https://sdkdocs.roku.com/display/sdkdoc/Handling+Application+Events
George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

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

Re: objFun() = no fun

One cannot callFunc() against an object like roDeviceInfo AFAIK
0 Kudos