Bug? 5.0 (and 3.8 aswell I believe) module naming issue

Discussion in 'Bugs & wishlist' started by sorex, Jun 3, 2015.

  1. sorex

    sorex Expert Licensed User

    Hello,

    I had some weird error while adding a new module to a project I just started.

    It seems that B4A doesn't like that a code module name start with a numeric character.
    Let's say 4321_class .

    It adds the module and your see it in the modules list (and B4A source) but you immediatly get an error during the adding or when clicking on the module in the module window.

    Is this by design?

    The class is also versioned 4.9 instead of 5.
     
  2. DonManfred

    DonManfred Expert Licensed User

    starting a modulename with a number is not a good idea
     
  3. sorex

    sorex Expert Licensed User

    why not?

    it could show a warning instead of adding it without being usable.
     
  4. DonManfred

    DonManfred Expert Licensed User

    B4a is creating java-code from b4a code.
    In java it is not allowed to start a variable / objectinstancename with a number or a special character.
    I can imagine that this can run into problems
     
    Peter Simpson likes this.
  5. Erel

    Erel Administrator Staff Member Licensed User

    This is not a bug. Module name must start with a letter. The add new module dialog will not allow you to add a module that starts with a number.
     
  6. sorex

    sorex Expert Licensed User

    @Erel, you're right when using doing it from scratch in the IDE.

    When I copy a class in the shared moduled file to a file with another name (appname_game or something) then there doesn't seem to be a check after the file dialogue.

    Maybe a forced rename could be done there. but that's something low prio now that I now that it doesn't like a number as first char.
     
Loading...