incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #1 Hi guys, I have this code that raised an error Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, SubToCall,RowId) Activity.Finish End Sub Change the code to this Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, "MySub",RowId) Activity.Finish End Sub Fix the error. It is a bug or a normal behavior?
Hi guys, I have this code that raised an error Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, SubToCall,RowId) Activity.Finish End Sub Change the code to this Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, "MySub",RowId) Activity.Finish End Sub Fix the error. It is a bug or a normal behavior?
DonManfred Expert Licensed User Longtime User Oct 12, 2016 #2 It seems to be a normal behaviour that you dont post the error you got. Upvote 0
incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #3 It seems to be a normal behavior that the error if not the issue here, so no need to post it, just simple question should it raised an error or not. Upvote 0
It seems to be a normal behavior that the error if not the issue here, so no need to post it, just simple question should it raised an error or not.
DonManfred Expert Licensed User Longtime User Oct 12, 2016 #4 if SubToCall contains the string MySub then it should work. Upvote 0
incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #5 I have tried it, it didn't work. The error is "Sub mysub doesn't found." mysub in the log is in lower capital, actual Sub name is MySub. Upvote 0
I have tried it, it didn't work. The error is "Sub mysub doesn't found." mysub in the log is in lower capital, actual Sub name is MySub.
DonManfred Expert Licensed User Longtime User Oct 12, 2016 #6 try Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, "mysub",RowId) Activity.Finish End Sub Upvote 0
incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #7 DonManfred said: try Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, "mysub",RowId) Activity.Finish End Sub Click to expand... This will work, but this Code: Copy Sub Test(RowId) Private SubToCall as String SubToCall = "mysub" CallSubDelayed2(CallFrom, SubToCall ,RowId) Activity.Finish End Sub Doesn't works java.lang.Exception: Sub mysub was not found. Upvote 0
DonManfred said: try Code: Copy Sub Test(RowId) CallSubDelayed2(CallFrom, "mysub",RowId) Activity.Finish End Sub Click to expand... This will work, but this Code: Copy Sub Test(RowId) Private SubToCall as String SubToCall = "mysub" CallSubDelayed2(CallFrom, SubToCall ,RowId) Activity.Finish End Sub Doesn't works java.lang.Exception: Sub mysub was not found.
I inakigarm Well-Known Member Licensed User Longtime User Oct 12, 2016 #8 Hace you tried with smart string literal. ---> $""${SubtoCall}""$? Upvote 0
DonManfred Expert Licensed User Longtime User Oct 12, 2016 #9 what is CallFrom? It should be an activity object... based on https://www.b4x.com/android/forum/t...teract-between-activities-and-services.18691/ Upvote 0
what is CallFrom? It should be an activity object... based on https://www.b4x.com/android/forum/t...teract-between-activities-and-services.18691/
LucaMs Expert Licensed User Longtime User Oct 12, 2016 #10 Your second code should work. Check if you have a module named CallFrom (CallFrom? Module to call!) and that this module has a routine named mysub. incendio said: Sub Test(RowId) Private SubToCall as String SubToCall = "mysub" CallSubDelayed2(CallFrom, SubToCall ,RowId) Activity.Finish End Sub Click to expand... Upvote 0
Your second code should work. Check if you have a module named CallFrom (CallFrom? Module to call!) and that this module has a routine named mysub. incendio said: Sub Test(RowId) Private SubToCall as String SubToCall = "mysub" CallSubDelayed2(CallFrom, SubToCall ,RowId) Activity.Finish End Sub Click to expand...
incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #11 DonManfred said: what is CallFrom? It should be an activity object... based on https://www.b4x.com/android/forum/t...teract-between-activities-and-services.18691/ Click to expand... Here are the code to call a sub in other activity Code: Copy Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","MySub") CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub And here are the codes from module ModSearchFrmN Code: Copy Sub Globals Private CallFrom As Object Private SubToCall As String End Sub Sub ShowData(Params As Map) CallFrom = Params.Get("CallFrom") SubToCall = Params.Get("SubToCall") End Sub Sub Test(RowId As Int) CallSubDelayed2(CallFrom, SubToCall,RowId) 'this is the error line Activity.Finish End Sub LucaMs said: Your second code should work. Check if you have a module named CallFrom (CallFrom? Module to call!) and that this module has a routine named mysub. Click to expand... There is no module named CallFrom inakigarm said: Hace you tried with smart string literal. ---> $""${SubtoCall}""$? Click to expand... CallSubDelayed2(CallFrom, $""${SubToCall}""$,RowId) -> didn't work either. java.lang.Exception: Sub "mysub" was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175) Upvote 0
DonManfred said: what is CallFrom? It should be an activity object... based on https://www.b4x.com/android/forum/t...teract-between-activities-and-services.18691/ Click to expand... Here are the code to call a sub in other activity Code: Copy Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","MySub") CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub And here are the codes from module ModSearchFrmN Code: Copy Sub Globals Private CallFrom As Object Private SubToCall As String End Sub Sub ShowData(Params As Map) CallFrom = Params.Get("CallFrom") SubToCall = Params.Get("SubToCall") End Sub Sub Test(RowId As Int) CallSubDelayed2(CallFrom, SubToCall,RowId) 'this is the error line Activity.Finish End Sub LucaMs said: Your second code should work. Check if you have a module named CallFrom (CallFrom? Module to call!) and that this module has a routine named mysub. Click to expand... There is no module named CallFrom inakigarm said: Hace you tried with smart string literal. ---> $""${SubtoCall}""$? Click to expand... CallSubDelayed2(CallFrom, $""${SubToCall}""$,RowId) -> didn't work either. java.lang.Exception: Sub "mysub" was not found. at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
LucaMs Expert Licensed User Longtime User Oct 12, 2016 #12 incendio said: There is no module named CallFrom Click to expand... With "module" I meant: Activity module or Code module or Service module. See the CallSubDelayed2 parameters; the first one must be the "module" which contains the routine to call. Upvote 0
incendio said: There is no module named CallFrom Click to expand... With "module" I meant: Activity module or Code module or Service module. See the CallSubDelayed2 parameters; the first one must be the "module" which contains the routine to call.
incendio Well-Known Member Licensed User Longtime User Oct 12, 2016 #13 LucaMs said: With "module" I meant: Activity module or Code module or Service module. See the CallSubDelayed2 parameters; the first one must be the "module" which contains the routine to call. Click to expand... There is no activity / service module with that name, CallFrom. CallFrom is just an Object variable. Upvote 0
LucaMs said: With "module" I meant: Activity module or Code module or Service module. See the CallSubDelayed2 parameters; the first one must be the "module" which contains the routine to call. Click to expand... There is no activity / service module with that name, CallFrom. CallFrom is just an Object variable.
lemonisdead Well-Known Member Licensed User Longtime User Oct 12, 2016 #14 My 50cts : the obfuscation ? Adding an underscore in the sub's name ? Upvote 0
incendio Well-Known Member Licensed User Longtime User Oct 13, 2016 #15 lemonisdead said: My 50cts : the obfuscation ? Adding an underscore in the sub's name ? Click to expand... You were right Change the codes into like this solved the problem Code: Copy Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","My_Sub") 'change Sub Name from MySub to My_Sub CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub Upvote 0
lemonisdead said: My 50cts : the obfuscation ? Adding an underscore in the sub's name ? Click to expand... You were right Change the codes into like this solved the problem Code: Copy Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","My_Sub") 'change Sub Name from MySub to My_Sub CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub
LucaMs Expert Licensed User Longtime User Oct 13, 2016 #16 incendio said: Change the code to this Click to expand... incendio said: Sub Test(RowId) CallSubDelayed2(CallFrom, "MySub",RowId) Activity.Finish End Sub Click to expand... incendio said: Fix the error. Click to expand... incendio said: Change the codes into like this solved the problem Click to expand... incendio said: Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","My_Sub") 'change Sub Name from MySub to My_Sub CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub Click to expand... ??? Upvote 0
incendio said: Change the code to this Click to expand... incendio said: Sub Test(RowId) CallSubDelayed2(CallFrom, "MySub",RowId) Activity.Finish End Sub Click to expand... incendio said: Fix the error. Click to expand... incendio said: Change the codes into like this solved the problem Click to expand... incendio said: Sub bbBatch_Clicked Private m As Map m.Initialize m.Put("CallFrom",Me) m.Put("SubToCall","My_Sub") 'change Sub Name from MySub to My_Sub CallSubDelayed2(ModSearchFrmN, "ShowData",m) End Sub Click to expand... ???
incendio Well-Known Member Licensed User Longtime User Oct 13, 2016 #17 LucaMs said: ??? Click to expand... Just look in post #15, this is latest answer Upvote 0
LucaMs Expert Licensed User Longtime User Oct 13, 2016 #18 incendio said: Just look in post #15, this is latest answer Click to expand... I saw but if that is the solution, your first post was wrong (this is what I meant with my post, #16) Upvote 0
incendio said: Just look in post #15, this is latest answer Click to expand... I saw but if that is the solution, your first post was wrong (this is what I meant with my post, #16)