Java Question ScriptBasic embeddable scripting engine for Java

ScriptBasic

Member
Licensed User
Longtime User
Hi B4A team,

I'm a new user to Basic4Android and think it's a great tool to develop Android applications. I'm just getting my arms around Java programming but have been a Basic programmer for over 40 years. I manage the open source project for the ScriptBasic ANSI/ISO C version of the scripting engine. It was written by Peter Verhas from Budapest Hungary.

Peter has recently released a Java version of ScriptBasic that I think would be a nice enhancement to Basic4Android as an embedded traditional typeless Basic scripting engine. I don't think it is going to be much of an effort to wrap SB4J in a library for Basic4Android. I just need some help from others that have gone down this road before. I have been playing with SB4J at the command line and I would like to get it working with B4A if all possible.

ScriptBasic Script
B4X:
FOR x = 1 TO 10
  a[x] = x
NEXT x

FOR z = 1 TO 10
  PRINT a[z],"\n"
NEXT z

jrs@laptop:~/SB4J$ java -jar jscriptbasic-1.0.3.jar jsb01.sb
1
2
3
4
5
6
7
8
9
10

ScriptBasic Script
B4X:
USE Math FROM java.lang
METHOD sin FROM java.lang.Math IS (double)
z = Math.sin(1.0)
PRINT z,"\n"

jrs@laptop:~/SB4J$ java -jar jscriptbasic-1.0.3.jar jsb04.sb
0.8414709848078965
jrs@laptop:~/SB4J$

Embedding SB4J (project site)

I have attached the SB4J (ScriptBasic for Java) JAR file to give this a try and hopefully get integrated into Basic4Android.
 
Last edited:

ScriptBasic

Member
Licensed User
Longtime User
Looks great and very feature rich.

Peter's goal with SB4J is a simplistic embeddable scripting engine that is easy to extend based on need. He isn't actively developing for the Android platform but I thought I would give it a try with Basic4Android.

No need to recreate the wheel and I'm going to use B4Script with my Android projects.

Thanks for the link and libraries.

John
 

ScriptBasic

Member
Licensed User
Longtime User
I have BasicIDE and B4Script compiled and working on my Samsung Galaxy Tab 2 10.1 tablet. Are these libraries open source? I can see the class files in the JAR but they aren't in a text file format.

I would like to contribute to this project but source access is a must.
 

ScriptBasic

Member
Licensed User
Longtime User
BasicLibIDE is not open source.

I thiink you did a great job with BasicIDE and having a ton of fun playing with it.

Peter Verhas is expanding on the string aspect of SB4J as the USE/METHOD syntax still sees Java strings as objects. Once the Java API is more accessible in a Basic like way, I will give the Basic4Android library effort another try. SB4J is a light weight embeddable scripting engine and not headed down BasicIDE's path.
 
Top