Hello @Erel and all the group. It's good to be back in the Forum after an extended absence.
I am currently looking for a simple lightweight solution to convert B4J Subs to JavaScript functions, without the need for integrated web development or UI design tools. Consider the following trivial example and please excuse any syntax errors.
There is a quite a bit of information, both on and off the Forum, about B4JS, ABMaterial, and BANano, dating from approximately 2018 to 2021. Among the sources I have consulted are:
alwaysbusycorner.com
www.b4x.com
gorgeousapps.com
I see that @alwaysbusy and others have invested considerable effort in this project and, at first glance, it seems like a comprehensive solution capable of much more than I need at this stage. I am certain it includes the capability to do what I am looking for but, unfortunately, I have not yet been able to locate it. Perhaps someone familiar with the library could help guide me to the right place in the documentation or provide a quick walk-through.
Another approach might be to try to filter and modify the contents of the .java file generated by the B4J compiler. In the case of the above example, it looks like:
Is there any documentation for this file? And even if there is, this approach feels too much like reverse-engineering instead of a simple solution to a simple problem.
Have I overlooked something? Any advice would be greatly appreciated. Many Thanks!
I am currently looking for a simple lightweight solution to convert B4J Subs to JavaScript functions, without the need for integrated web development or UI design tools. Consider the following trivial example and please excuse any syntax errors.
B4X:
Sub Pythagoras(a As Double, b As Double) As Double
Dim c As Double
c = Sqrt((a*a) + (b*b))
Return c
End Sub
JavaScript:
Function Pythagoras(a, b) {
let c = Math.sqrt((a*a)+(b*b));
return c;
}
There is a quite a bit of information, both on and off the Forum, about B4JS, ABMaterial, and BANano, dating from approximately 2018 to 2021. Among the sources I have consulted are:
February 2021 – Alwaysbusy's Corner
2 posts published by Alwaysbusy during February 2021
[Web][BANano] Website/App/PWA library with Abstract Designer support
Download the latest version here: https://www.b4x.com/android/forum/threads/banano-a-sneak-peek-into-a-progressive-web-app-library.99740/#post-627764 INTRO BANano is a new B4J library to websites/webapps with (offline) Progressive Web App support. Unlike its big brother ABMaterial, BANano...
BANano Skeleton
I see that @alwaysbusy and others have invested considerable effort in this project and, at first glance, it seems like a comprehensive solution capable of much more than I need at this stage. I am certain it includes the capability to do what I am looking for but, unfortunately, I have not yet been able to locate it. Perhaps someone familiar with the library could help guide me to the right place in the documentation or provide a quick walk-through.
Another approach might be to try to filter and modify the contents of the .java file generated by the B4J compiler. In the case of the above example, it looks like:
Java:
public static double _pythagoras(double _a,double _b) throws Exception{
double _c = 0;
//BA.debugLineNum = 23;BA.debugLine="Sub Pythagoras(a As Double, b As Double) As Double";
//BA.debugLineNum = 25;BA.debugLine="Dim c As Double";
_c = 0;
//BA.debugLineNum = 27;BA.debugLine="c = Sqrt((a*a) + (b*b))";
_c = anywheresoftware.b4a.keywords.Common.Sqrt((_a*_a)+(_b*_b));
//BA.debugLineNum = 29;BA.debugLine="Return c";
if (true) return _c;
//BA.debugLineNum = 31;BA.debugLine="End Sub";
return 0;
}
Is there any documentation for this file? And even if there is, this approach feels too much like reverse-engineering instead of a simple solution to a simple problem.
Have I overlooked something? Any advice would be greatly appreciated. Many Thanks!