Android Question StringFunctions Library generates error in B4A version 6.8

almontgreen

Active Member
Licensed User
Longtime User
Installed B4A version 6.8 and now get error:

java.lang.NoSuchMethodError: anywheresoftware.b4a.keywords.Common.Msgbox
at adr.stringfunctions.stringfunctions._vvvv4(stringfunctions.java:450)

which I presume indicates that the stringfunctions messagebox function isn't supported by version 6.8.

My question is, do I need to eliminate this library for B4A version 6.8? Or is there an update to the library? I did refresh the library and that made no difference.
 

klaus

Expert
Licensed User
Longtime User
From the StringFunctions documentation there is no Common nor MsgBox function.
What B4A line gives you the error?
Probably it needs a new compilation with B4A 6.80.
Unfortunately, the author, margret, seems to be no more active in the forum.
I suppose that only she has the source code.
In the first time StringFunctions was a Code module, and then it was compiled into a library.

Now, my pesronal opinion.
I have never used StringFunctions, why?
In my opinion, StringFunctions was wriiten to add VB style methods to B4A.
When I use a language, I use whenever I can the native methods instead of workarounds adapting previous habits to the 'new' language.
But, as already said, that's just my opinion.
 
Last edited:
Upvote 0

almontgreen

Active Member
Licensed User
Longtime User
The only part of the library that has a problem is the messagebox function with a single parameter. sf.mb("alert message") All other functions work fine. So I switched to the built in Msgbox function with two parameters and everything is working great. Here is the stack trace:

Logger connected to: samsung Nexus 10
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.NoSuchMethodError: anywheresoftware.b4a.keywords.Common.Msgbox
at adr.stringfunctions.stringfunctions._vvvv4(stringfunctions.java:450)
at b4a.example.main._activity_create(main.java:378)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:816)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:632)
at dalvik.system.NativeStart.main(Native Method)
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = true **
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the correct solution. Avoid using this method.

BTW, I agree with Klaus that in the long run it is worth learning to use the built-in string methods. They are the same in B4A, B4i, B4J and are also similar to the methods in B4R.
They are powerful enough that there is no need to add another abstraction layer above them.
 
Upvote 0
Top