Announcement

Collapse
No announcement yet.

New feature

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New feature

    A switch to allow CASE sensibility on or off. I always find
    myself mixing up variables by typing MyVariabele and then
    myVariable or myvariable etc... Allowing a mechanism for
    CASE sensitivity would be a nice feat

    Steven.

    ------------------
    So here we are, this is the end.
    But all that dies, is born again.
    - From The Ashes (In This Moment)

  • #2
    Internally, PowerBASIC capitalizes all variable, label, Sub & Function names during the compilation process (hence the need to use an ALIAS clause in declarations and prototypes). Therefore, capitalization of the variables "Cat&" and "CAT&" in source code does not cause compilation errors.

    However, adding mixed-capitalization support to the compiler itself would be a big job, and likely to cause all sorts of grief to existing code unless it was somehow made optional.

    It would "probably" be easier to add capitalization-checking into the IDE's editor, but I can't speak on behalf of R&D, so I can only pass your request along for consideration. I do see problems with this though, as the IDE would need to know what format you want your variable names to be set to... using the format in a DIM statement would mean problems when code does not use #DIM ALL. Also it gets complicated when assessing whether any given variable name was local or global, so it adds a large layer of complexity to solve the issue (in the case where differing capitalization was used for global and locals for identically named variables - ie, GLOBAL MyVar& and LOCAL MYVAR&). Using just the first instance of the variable would probably solve this issue, but I've seen a number of people who use fully-capitalized variables for global, and mixed case for locals, so they would probbaly be unhappy with this... argh!)

    Another strategy would be to use a separate cross-reference utility, but it weould not help dynamically (while you are actually typing code into the IDE).

    I've been working on a xref utility for PowerBASIC (in my spare time... hah!), but it will be some time before I have completed the project.

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      However, adding mixed-capitalization support to the compiler itself would be a big job, and likely to cause all sorts of grief to existing code unless it was somehow made optional.
      Actually, changing the compiler to support mixed-case symbols should not be that big a job.. when parsing you just skip the upper-case step which has to be there..

      But.. unless you want a full-scale revolt, such a feature would DEFINETLEY need to be optional (e.g., metastatements like #SYMBOL MIXED or #VARIABLE UPPER or #PROCEDURE UCASE)

      MCM


      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment


      • #4
        Whoa! Would this open a can of worms!

        In the not-too-distant past, I worked with another compiler that permitted mixed case variables (e.g.: Cat%, cat% and caT% were all different variables). Unfortunately, this compiler did not have the option of turning this feature on or off. I can't tell you the hours wasted because I typed Z1% instead of z1%. It is very easy to introduce such bugs in your code with case-sensitive variables.

        Since switching to PB/DLL, I have forced myself to use #DIM ALL at the beginning of each program. It has saved my bacon countless times already.

        Add the option to have mixed-case variables if there is enough demand, but only as an option!

        Frank

        ------------------

        Comment


        • #5
          Bleh !

          I am used to working in both, asm and C both use mixed case and
          while it has some advantages, you code a lot faster in BASIC because
          it is not case sensitive.

          In languages that are structured to have ONLY declared variables
          at the beginning of each procedure, case sensitive is no big deal
          as you make each one as you need it but where BASIC is a 2 pass
          compiler that handles variables on the fly, restricting it to,

          1. #DIM ALL

          2. Case sensitive

          is a waste of this extra flexibility. I NEVER use DIM ALL as it slows
          down the development speed. Discipline solves the messups but speed
          of development is not worth sacrificing for something that does not
          improve the code.

          There are some things from C I am happy to leave behind, I wear it in
          ASM because you have an advantage from the coding type but where
          PowerBASIC already performs better than the C compilers I remember,
          why make it slower when it is one of the truly fast languages left
          to develop in.

          Regards,

          [email protected]

          ------------------
          hutch at movsd dot com
          The MASM Forum

          www.masm32.com

          Comment

          Working...
          X