Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
goya
Visitor

need help with Run()

ok i'm working on benchmarks and i'm a little confused with Run()

I have a benchmark.brs lets say that has Main() and it wants to do a call to Run() with "pkg:/run_test.brs"

but when I try it I get that line 1, error code &had: SUB or FUNCTION defined twice.

When I call Run() from the documentation "Args may be passed to the scripts Main() function, and the called script may return arguments." so i figure i need something like sub Main(args) but yes I already have one in my bechmarks.brs...

I did look at the provided example... "Run("pkg:/test.brs")"

but the example does not give the source code for "test.brs" for me to look at... Do I have to not use Main() and give some other subroutine name, if so how do I specify the subroutine name to call, is it the first parameter...

Or do I need to put it in some other directory, lib sub directory tests and then it would not conflict... sort of namespace kind of thing... (ok tried that, didn't work)

Please help

I would really like to finish todays benchmarks of all built in functions...

then i can move to statements and finally components...

oh yeah and porting those famous 40 benchmarks i keep mentioning, but never get too...

i figured i would do all the easy ones so i could learn the language and then get to porting stuff written in other languages....
0 Kudos
1 REPLY 1
goya
Visitor

Re: need help with Run()

ok i just created a sub in the brs im going to run and then i figure it will load that in and compile it and what ever subroutine that i have in the brs will be available to me in my benchmarks brs

ok that was it... now working.... i guess

documentation talk about being a Main() in script being runned confused me. maybe documentation needs to be updated...

maybe better example that shoulds include source code to both the caller (the script with the run()) and the callee the script being called
0 Kudos