Page 5 of 5

Re: PureBasic 5.30 is out !

Posted: Thu Sep 11, 2014 1:08 am
by blueznl
I spotted one troublesome change in 5.30 (not sure if it should be considered a bug, it's more like something being overlooked)...

> Changed: DataSection label within Procedure are now local labels.

I think this isn't such a good idea. (Well, at least for me it isn't :-)) or perhaps labels / datasections deserve the keyword 'Global'.

Here's the issue:

I have some code with many include files. To keep the (folded) code clean I grouped most of those includes together in a procedure called 'init()'. Put the cursor on the Procedure init() line, hit F4, and voila, all includes are hidden from sight.

Previously I could refer to the includes using their labels, all throughout my code. Now the only way to access those includes is to place them outside a procedure, otherwise the label won't be found.

I think a better solution would be allowing the use of the keyword Global, either with Datasection (and have all labels within the datasection be global) or use the keyword Global in combination with the labe itselfl.

As it is now, I'm a bit stuck with 5.30. I don't want to move all includes to the 'root' of my code so I guess I'll go back to 5.22 LTS...

(I haven't checked out the next beta, did it fix this?)

Re: PureBasic 5.30 is out !

Posted: Thu Sep 11, 2014 1:21 am
by IdeasVacuum
How about putting the includes in a separate .pbi file?

Re: PureBasic 5.30 is out !

Posted: Thu Sep 11, 2014 6:49 am
by Danilo
blueznl wrote:To keep the (folded) code clean I grouped most of those includes together in a procedure called 'init()'. Put the cursor on the Procedure init() line, hit F4, and voila, all includes are hidden from sight.
You can create sections for folding easily without putting it into procedures:

Code: Select all

;{ data sections
DataSection
    myLabel: : Data.i 10
EndDataSection
;}
Add your own markers in Preferences > Editor > Folding.

Re: PureBasic 5.30 is out !

Posted: Thu Sep 11, 2014 7:22 pm
by blueznl
Well, I'll just settled for adding another global var, that fixed it as well:

Code: Select all

...
Datasection
  whatever:
  Includebinary ....
EndDatasection
Global include_whatever = ?whatever
...