Bug? B4A V8 beta#1 resumable sub error

Discussion in 'Bugs & wishlist' started by DavideV, Mar 12, 2018.

  1. DavideV

    DavideV Active Member Licensed User

    Error compiling when the sub looks like:
    Code:
    '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:

    Code:
    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:

    Code:
    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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Can you send me your project or upload a small project that reproduces this error?
     
  3. DavideV

    DavideV Active Member Licensed User

    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:
    Code:
    'browser selected
    Sub SelectBrowser_Click(Index As Int)
    Dim Url As UrlInfo=Browsers.Get(Index)
    into:
    Code:
    'browser selected
    Sub SelectBrowser_Click(Idx As Int)
    Dim Url As UrlInfo=Browsers.Get(Idx)
    to get it compiled
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    Thank you.

    This bug happens when a parameter variable is redimmed inside a resumable sub:
    Code:
    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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice