Daestrum Expert Licensed User Longtime User Nov 22, 2018 #1 If I create a standard class module in a project and then try to access it from inline java, the class name has become all lowercase. A class module named Person should produce a class named 'Person', but actually creates one called 'person'. (the same is true of type definitions, they produce lowercase class names too) If there is a good reason for it I can work around it and please ignore this post, but it does go against Java naming conventions for classes.
If I create a standard class module in a project and then try to access it from inline java, the class name has become all lowercase. A class module named Person should produce a class named 'Person', but actually creates one called 'person'. (the same is true of type definitions, they produce lowercase class names too) If there is a good reason for it I can work around it and please ignore this post, but it does go against Java naming conventions for classes.
alwaysbusy Expert Licensed User Longtime User Nov 22, 2018 #2 I think this is by design. Java is case sensitive but B4X, in tradition of VB, is not. This makes in one thing less to think of for us, the programmers. Example in this case where both statements will work because of the lowercasing, while if the case was preserved, it would mean calling two different methods: Code: Copy CallSub(main, "myMethod") CallSub(main, "MyMethod") I use the same 'trick' in my ABM library where for example the ID of a html tag is also case sensitive, but in B4X it doesn't matter if you use: Code: Copy Dim label as ABMLabel = ABM.GetComponent("myID") Dim label as ABMLabel = ABM.GetComponent("myid") Upvote 0
I think this is by design. Java is case sensitive but B4X, in tradition of VB, is not. This makes in one thing less to think of for us, the programmers. Example in this case where both statements will work because of the lowercasing, while if the case was preserved, it would mean calling two different methods: Code: Copy CallSub(main, "myMethod") CallSub(main, "MyMethod") I use the same 'trick' in my ABM library where for example the ID of a html tag is also case sensitive, but in B4X it doesn't matter if you use: Code: Copy Dim label as ABMLabel = ABM.GetComponent("myID") Dim label as ABMLabel = ABM.GetComponent("myid")
Erel B4X founder Staff member Licensed User Longtime User Nov 22, 2018 #3 This is not a bug. Moved to the questions forum. Upvote 0