This post is no longer valid! B4JS has been rewritten from the ground up and will first introduced in In ABM 4.25. Stay tuned...
------------------------------------------------------------------------------
Old post:
As my proof-of-concept in converting B4J code to Javascript worked, I've decided to start over and build B4JS from the ground up. Just as B4A 1.0 could not do everything, so won't B4JS 1.0 in the beginning. But I plan to support Classes, Modules etc too in the future.
I've started with the conversion of the B4J core. This is an overview of what can be used (and what not). Most of the 'Nots' are specific methods needed for B4J and which do not exist in JavaScript. But I'm happy with it can do already. Some methods were real brain-teasers, because Java and Javascript are two completely different languages.
Next up is implementing this for the first ABMComponent. It will be ABMXPlay as it will benefit the most from B4JS and it will be a good learning experience to see how to implement if for the other ABMaterial components.
B4JS 1.0
Write familiar B4J code and it will be converted to Javascript.
B4J Core
Bookmark this topic if you want to keep up to date with my progress. Is on hold as the poll wanted the Abstract Designer first. But still planned to be build in!
Alwaysbusy
------------------------------------------------------------------------------
Old post:
As my proof-of-concept in converting B4J code to Javascript worked, I've decided to start over and build B4JS from the ground up. Just as B4A 1.0 could not do everything, so won't B4JS 1.0 in the beginning. But I plan to support Classes, Modules etc too in the future.
I've started with the conversion of the B4J core. This is an overview of what can be used (and what not). Most of the 'Nots' are specific methods needed for B4J and which do not exist in JavaScript. But I'm happy with it can do already. Some methods were real brain-teasers, because Java and Javascript are two completely different languages.
Next up is implementing this for the first ABMComponent. It will be ABMXPlay as it will benefit the most from B4JS and it will be a good learning experience to see how to implement if for the other ABMaterial components.
B4JS 1.0
Write familiar B4J code and it will be converted to Javascript.
B4J Core
- Variable Types
- Supported:
Array, Byte, Boolean, Double, Float, Int, List, Map, String - Not Supported:
Other B4J Types, Classes, Modules, Object
Variables declared in Global without the prefix B4JS
- Supported:
And, Not, Or, ParseInt, ShiftLeft, ShiftRight, ToBinaryString, toHexString, ToOcatalString, UnsignedShiftRight, Xor - Not Supported:
InputStreamToBytes
- Supported:
CharAt, CompareTo, Contains, EndsWith, EqualsIngoreCase, GetBytes, IndexOf, indexOf2, LastIndexOf, LastIndexOf2, Length, Replace, StartsWidth, SubString, Substring2, ToLowerCase, ToUpperCase, Trim
- Supported:
Initialize, Clear, ContainsKey, Get, GetDefault, GetKeyAt, GetValueAt, IsInitialized, Remove, Size, Values, Keys, Put
- Supported:
Initialize, Initialize2, Get, Add, AddAllAt, Clear, IndexOf, InsertAt, IsInitialized, RemoveAt, Size, Set, Sort, SortCaseInsensitive - Not Supported:
SortType, SortTypeCaseInsensitive
- Supported:
Abs, ACos, ACosD, Array, Asc, ASin, ASinD, ATan, ATan2, ATan2D, ATanD, BytesToString, Catch, cE, Ceil, Chr, Continue, Cos, CosD, cPI, Dim, Exit, False, Floor, Is, IsNumber, LastException, Log, Logarithm, LogDebug, Max, Min, Not, Null, Power, Return, Rnd, RndSeed, Round, Round2, Sin, SinD, Sqrt, Sub, Tan, TanD - Not Supported:
Typical B4J methods, not applicable in Javascript like: CallSub, CreateMap, CRLF, Density, ExitApplication, File, GetenvironmentVariable, GetSystemProperty, IsDevTool, Me, NumberFormat, RegEx, StartMessageLoop, ...
- Supported:
=, <>, <, >, <=, >=, And, Or, (, ), + , -, /, Mod
- Supported:
If, Then, Else, End If, For, For Each, Next, Select, Case, Case Else, End Select, Do While, Do Until, Loop, Try, Catch, End Try
- Supported:
Bookmark this topic if you want to keep up to date with my progress. Is on hold as the poll wanted the Abstract Designer first. But still planned to be build in!
Alwaysbusy
Last edited: