It is currently Tue Feb 25, 2020 10:11 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5
Author Message
 Post subject: Re: PureBasic 5.30 is out !
PostPosted: Thu Sep 11, 2014 1:08 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6073
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?)

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.30 is out !
PostPosted: Thu Sep 11, 2014 1:21 am 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6001
Location: Wales, UK
How about putting the includes in a separate .pbi file?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.30 is out !
PostPosted: Thu Sep 11, 2014 6:49 am 
Offline
Addict
Addict
User avatar

Joined: Sat Apr 26, 2003 8:26 am
Posts: 2942
Location: Planet Earth
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:
;{ data sections
DataSection
    myLabel: : Data.i 10
EndDataSection
;}

Add your own markers in Preferences > Editor > Folding.


Top
 Profile  
Reply with quote  
 Post subject: Re: PureBasic 5.30 is out !
PostPosted: Thu Sep 11, 2014 7:22 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat May 17, 2003 11:31 am
Posts: 6073
Well, I'll just settled for adding another global var, that fixed it as well:

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

_________________
( PB5.xx Win10 x64 Asrock AB350 Pro4 Ryzen 1600X 32GB RAM Evo 840 GTX1060 )
( The path to enlightenment and the PureBasic Survival Guide right here... )


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 64 posts ]  Go to page Previous  1, 2, 3, 4, 5

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye