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?

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top