DavideV Active Member Licensed User Longtime User Mar 12, 2018 #1 Error compiling when the sub looks like: B4X: 'browser selected Sub SelectBrowser_Click(Index As Int) Dim Url As UrlInfo=Browsers.Get(Index) The problem is the 'Index as int' variable naming that seems to be used by the resumable sub class also: B4X: public static void _selectbrowser_click(int _index) throws Exception{ ResumableSub_SelectBrowser_Click rsub = new ResumableSub_SelectBrowser_Click(null,_index); rsub.resume(processBA, null); } public static class ResumableSub_SelectBrowser_Click extends BA.ResumableSub { public ResumableSub_SelectBrowser_Click(it.davidev.tagapplauncher.activitybrowseurl parent,int _index) { this.parent = parent; this._index = _index; } The compiler error: B4X: B4A Version: 8.00 BETA #1 Parsing code. (0.55s) Compiling code. (3.69s) Compiling layouts code. (0.14s) Organizing libraries. (0.00s) Generating R file. (1.40s) Compiling generated Java code. Error B4A line: 485 End Sub src\it\davidev\tagapplauncher\activitybrowseurl.java:815: error: cannot find symbol this._index = _index; ^ symbol: variable _index This didn't happen with B4A V7.80
Error compiling when the sub looks like: B4X: 'browser selected Sub SelectBrowser_Click(Index As Int) Dim Url As UrlInfo=Browsers.Get(Index) The problem is the 'Index as int' variable naming that seems to be used by the resumable sub class also: B4X: public static void _selectbrowser_click(int _index) throws Exception{ ResumableSub_SelectBrowser_Click rsub = new ResumableSub_SelectBrowser_Click(null,_index); rsub.resume(processBA, null); } public static class ResumableSub_SelectBrowser_Click extends BA.ResumableSub { public ResumableSub_SelectBrowser_Click(it.davidev.tagapplauncher.activitybrowseurl parent,int _index) { this.parent = parent; this._index = _index; } The compiler error: B4X: B4A Version: 8.00 BETA #1 Parsing code. (0.55s) Compiling code. (3.69s) Compiling layouts code. (0.14s) Organizing libraries. (0.00s) Generating R file. (1.40s) Compiling generated Java code. Error B4A line: 485 End Sub src\it\davidev\tagapplauncher\activitybrowseurl.java:815: error: cannot find symbol this._index = _index; ^ symbol: variable _index This didn't happen with B4A V7.80
Erel B4X founder Staff member Licensed User Longtime User Mar 13, 2018 #2 Can you send me your project or upload a small project that reproduces this error?
DavideV Active Member Licensed User Longtime User Mar 14, 2018 #3 Here you are. the project does nothing, but is enough to see the error. I use: B4A V8 beta 1 JDK 9.04 just change the lines: B4X: 'browser selected Sub SelectBrowser_Click(Index As Int) Dim Url As UrlInfo=Browsers.Get(Index) into: B4X: 'browser selected Sub SelectBrowser_Click(Idx As Int) Dim Url As UrlInfo=Browsers.Get(Idx) to get it compiled Attachments testCompilerError.zip 23.1 KB · Views: 176
Here you are. the project does nothing, but is enough to see the error. I use: B4A V8 beta 1 JDK 9.04 just change the lines: B4X: 'browser selected Sub SelectBrowser_Click(Index As Int) Dim Url As UrlInfo=Browsers.Get(Index) into: B4X: 'browser selected Sub SelectBrowser_Click(Idx As Int) Dim Url As UrlInfo=Browsers.Get(Idx) to get it compiled
Erel B4X founder Staff member Licensed User Longtime User Mar 14, 2018 #4 Thank you. This bug happens when a parameter variable is redimmed inside a resumable sub: B4X: Sub SelectBrowser_Click(Index2 As Int) Sleep(100) Dim Index2 As Int End Sub I've checked it and it also happens with previous versions of B4A. It is fixed.
Thank you. This bug happens when a parameter variable is redimmed inside a resumable sub: B4X: Sub SelectBrowser_Click(Index2 As Int) Sleep(100) Dim Index2 As Int End Sub I've checked it and it also happens with previous versions of B4A. It is fixed.