Hello,
I am a newbie and have aquestion about BScript, If I have a function in play.brs as:
function play ()
print “this is just to see if the function call works”
end function
and I am calling it from appMain.brs as follows:
play()
I get the following error in console debug:
Function Call Operator ( ) attempted on non-function. (runtime error &he0) in …QpQxj/pkg:/source/appMain.brs(9)
If that is the exact script then my guess your error is on the function line as it looks like you have a space between play and (). Calling functions across files does work fine and does not need anything extra, if you equate it to other languages everything compiles into one class (just a very rough analogy).
FYI, all your brightscript files need to end with .brs and they should all be within the source folder in your package. If the files do not have a .brs extension then the contents will not be interpreted as brightscript, perhaps something like that is why it isn’t finding the play function. A space between play and () doesn’t matter
all Operator ( ) attempted on non-function. (runtime error &he0) in pkg:/source/main.brs(64) 064: playGameById()
mainScene.brs function I’m trying to call
Function playGameById() as Void
print “playGameById”
print id
End Function[/color]
main.brs function where I’m trying to call mainScene function
Sub deepLink(args) if (args.mediaType <> invalid) and (args.contentID <> invalid) print args.mediaType print args.contentID playGameById() else print ‘do nothing’ end if End Sub[/color]