Daestrum Expert Licensed User Longtime User Dec 30, 2013 #1 How can I pass a sub name to a library. (like timer has a parameter for the sub name to be called) I have tried listing all the declared methods in the module, but can't find the subs.
How can I pass a sub name to a library. (like timer has a parameter for the sub name to be called) I have tried listing all the declared methods in the module, but can't find the subs.
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2013 #2 Are you writing a Java library or compiling your project to a library? Upvote 0
Daestrum Expert Licensed User Longtime User Dec 30, 2013 #3 working on the jAnimation library, but want to be able to handle some events in the b4J program, such as eventhandlers for animations. Upvote 0
working on the jAnimation library, but want to be able to handle some events in the b4J program, such as eventhandlers for animations.
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2013 #4 See the tutorials here: http://www.b4x.com/android/forum/forums/libraries-developers-questions.32/ you should use ba.raiseEventFromUI. Upvote 0
See the tutorials here: http://www.b4x.com/android/forum/forums/libraries-developers-questions.32/ you should use ba.raiseEventFromUI.
Daestrum Expert Licensed User Longtime User Dec 30, 2013 #5 Thank you, for the speedy reply and a great programming tool. Upvote 0
Daestrum Expert Licensed User Longtime User Dec 30, 2013 #6 I have read lots of the postings, and still I cannot grasp how it it supposed to work. the sub in the B4J is checkPath I have added BA ba; to code, but even calling ba.subExists("checkPath") generates a null pointer exception. I have tried with "checkpath" "_checkpath" "_checkPath" all with the same result. Stumped.... Upvote 0
I have read lots of the postings, and still I cannot grasp how it it supposed to work. the sub in the B4J is checkPath I have added BA ba; to code, but even calling ba.subExists("checkPath") generates a null pointer exception. I have tried with "checkpath" "_checkpath" "_checkPath" all with the same result. Stumped....
agraham Expert Licensed User Longtime User Dec 30, 2013 #7 Sub names are lower-cased in htSubs. It should look something like this and just work. B4J Code: Copy Sub CheckPath ... End Sub Java Code: Copy public void Something(BA ba, String subname) { if (ba.subExists(subname.toLowerCase()) { ... } } Upvote 0
Sub names are lower-cased in htSubs. It should look something like this and just work. B4J Code: Copy Sub CheckPath ... End Sub Java Code: Copy public void Something(BA ba, String subname) { if (ba.subExists(subname.toLowerCase()) { ... } }
Daestrum Expert Licensed User Longtime User Dec 30, 2013 #8 Thank you - didn't realize BA was a hidden parameter sent with the call. Working now Its amazing that a simple hint opens up your eyes to what to do. So glad there are people on here who a) know what they are doing b) don't mind helping others. Last edited: Dec 30, 2013 Upvote 0
Thank you - didn't realize BA was a hidden parameter sent with the call. Working now Its amazing that a simple hint opens up your eyes to what to do. So glad there are people on here who a) know what they are doing b) don't mind helping others.