No announcement yet.

3.5vs3.2: User-defined variables, SHARED SUB

  • Filter
  • Time
  • Show
Clear All
new posts

  • 3.5vs3.2: User-defined variables, SHARED SUB

    In 3.2 I got used to having to specifically declare user-defined variables (TYPE ... END TYPE) as SHARED, notwithstanding that a sub was declared SHARED in its SUB statement declaration. I.E., ONLY standard data types were included in the SHARED type, as distinct from using a SHARED statement.

    In 3.5, recompiling some of my programs, I seem to have some new bugs. So I am wondering: Was that changed in 3.5? Are user-defined var types now included in the SHARED keyword in a SUB statement? If so, I'll have some fixing to do.

    I'm not complaining; I just need to know.



  • #2
    To the best of my knowledge, nothing was changed in respect to variable scoping rules between 3.2 and 3.5. Additionally, if such a change was made, it would have been documented in the README.TXT file that installed with PB/DOS 3.5.

    Maybe you could post an example of the code that is causing you problems in PB3.5? Thanks!

    PS: Do you tend to use the same variable names as local variables AND shared variables in your code? If so, you have laid the foundations for reduced maintainability and the possibility of introducing subtle bugs into your code because it is now not always 100% clear whether code in a Sub/Function is supposed to reference a LOCAL or a SHARED variable.

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