Adie Member Licensed User Longtime User Sep 21, 2017 #1 Hi I am looking for an interpreter that I can use to execute a .BAS file at runtime. The B4A app must be able to post the variables to the interpreter and then call the code (maybe a SUB). On return from the sub the required variables must be 'read' back and local processing will continue. I am porting an industrial control program from Windows (C++) to Android things. We currently use a product 'FastScript' that can compile C++ code on the fly and execute it almost at main app speed. It is seen as an object by the host app. All variables in the script have read/write access from the main app. I looked at this: https://www.b4x.com/android/forum/t...-for-android-programming-on-the-device.41468/ As I am new (seldom use) to B4A I've got no clue where to start. Any Ideas? Adie
Hi I am looking for an interpreter that I can use to execute a .BAS file at runtime. The B4A app must be able to post the variables to the interpreter and then call the code (maybe a SUB). On return from the sub the required variables must be 'read' back and local processing will continue. I am porting an industrial control program from Windows (C++) to Android things. We currently use a product 'FastScript' that can compile C++ code on the fly and execute it almost at main app speed. It is seen as an object by the host app. All variables in the script have read/write access from the main app. I looked at this: https://www.b4x.com/android/forum/t...-for-android-programming-on-the-device.41468/ As I am new (seldom use) to B4A I've got no clue where to start. Any Ideas? Adie
Erel B4X founder Staff member Licensed User Longtime User Sep 22, 2017 #2 Check the Eval class: https://www.b4x.com/android/forum/threads/b4x-eval-expressions-evaluator.54629/#content It is not built for running code. Only expressions. You can however extend it. Whether it is practical or not depends on your requirements. Upvote 0
Check the Eval class: https://www.b4x.com/android/forum/threads/b4x-eval-expressions-evaluator.54629/#content It is not built for running code. Only expressions. You can however extend it. Whether it is practical or not depends on your requirements.
Adie Member Licensed User Longtime User Sep 23, 2017 #3 Ok, I found BeanShell, a full Java interpreter. Look Here: http://www.beanshell.org/intro.html There is a downloadable .JAR file (bsh-core) which is all I need to 'get into B4A' Questions: 1: how do I generate the .XML file from the JAR? 2: before I spend too much time on this, will this work? Adie Upvote 1
Ok, I found BeanShell, a full Java interpreter. Look Here: http://www.beanshell.org/intro.html There is a downloadable .JAR file (bsh-core) which is all I need to 'get into B4A' Questions: 1: how do I generate the .XML file from the JAR? 2: before I spend too much time on this, will this work? Adie
Adie Member Licensed User Longtime User Sep 23, 2017 #4 And then I found BasicLib 1.4 from agraham that will work for now so I can carry on with the development. I would prefer BeanShell. Still don't know how to access the subs in the BeanShell JAR file which I would like to use. Adie Upvote 0
And then I found BasicLib 1.4 from agraham that will work for now so I can carry on with the development. I would prefer BeanShell. Still don't know how to access the subs in the BeanShell JAR file which I would like to use. Adie