Question

I have two files in source folder (BrightScript project), file a.brs and file b.brs

There is a function in a.brs file

function aa()
    print "Hello World!"
end function

and I want to call it from b.brs

aa()

There is an error

Function Call Operator ( ) attempted on non-function. (runtime error &he0)

I can not understand this problem.Can anybody help me?

Was it helpful?

Solution

Try Function aa() as Void, it might be missing the type on the function declaration.

OTHER TIPS

In my experience, I missed to import the file's path in my component. So I got similar issue in my code. Once I added this script_file_path in my component file I had got access to those functions

Add these two file paths in your component

<script type = "text/brightscript" uri = "pkg:/source/a.brs"/>
<script type = "text/brightscript" uri = "pkg:/source/b.brs"/>

then from both the files you can access the other file's functions

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top