It is currently Sun May 26, 2013 9:41 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: #PB_Compiler_EnumerationValue
PostPosted: Thu Nov 22, 2012 4:20 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2865
Location: Wales, UK
The form designer appends an Enumeration list with the flag #PB_Compiler_EnumerationValue.

I hadn't come across this flag before and potentially have hit an issue with it:

Code:
[ERROR] #Image object number is very high (over 100000), are You sure of that ?


The error is referring to constant number 14 in an Enumeration of 69 :shock:

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


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Thu Nov 22, 2012 4:58 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 394
IdeasVacuum wrote:
The form designer appends an Enumeration list with the flag #PB_Compiler_EnumerationValue.
I hadn't come across this flag before and potentially have hit an issue with it:
Code:
[ERROR] #Image object number is very high (over 100000), are You sure of that ?
Hi IdeasVacuum. As you know, the #PB_Compiler_EnumerationValue is a continuity flag to chain constant enumerations from a previous block. Perhaps you could check the assigned constant values with Debug, or post the Enumeration block here for us to counter check on other versions/platforms.

Thanks.

_________________
Texas Instruments 99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Thu Nov 22, 2012 7:20 am 
Offline
Addict
Addict
User avatar

Joined: Wed Feb 17, 2010 12:00 am
Posts: 979
Location: Anderson Island, WA
TI-994A wrote:
IdeasVacuum wrote:
The form designer appends an Enumeration list with the flag #PB_Compiler_EnumerationValue.
I hadn't come across this flag before and potentially have hit an issue with it:
Code:
[ERROR] #Image object number is very high (over 100000), are You sure of that ?
Hi IdeasVacuum. As you know, the #PB_Compiler_EnumerationValue is a continuity flag to chain constant enumerations from a previous block. Perhaps you could check the assigned constant values with Debug, or post the Enumeration block here for us to counter check on other versions/platforms.

Thanks.


Is there a way to get the last value? Let's suppose you're using a form designer and you get:

Enumeration ; Gadgets
#text1
#string1
#progressbar
endenumeration

Then later, you want to 'continue' the gadget list, but had other enumerations in between -- is there a way to say "Continue Gadget Enumerations"


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Thu Nov 22, 2012 10:18 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2865
Location: Wales, UK
Quote:
#PB_Compiler_EnumerationValue is a continuity flag to chain constant enumerations from a previous block


I didn't know that, but if that is the case, perhaps it shouldn't be assigned to an Enumeration block if there is only one block? Any how, I simply removed the flag and all is well.

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


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 7:46 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2258
Location: UK
This flag is very important when your project includes several .pbf files, as well as code that use enumeration as well, so that there are no duplicates.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:00 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
@Polo

but is not the best way. Numerates all objectstypes in one, this waste memory.

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:11 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2258
Location: UK
ts-soft wrote:
@Polo

but is not the best way. Numerates all objectstypes in one, this waste memory.

I can't think of a better way, though.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:32 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
Creation of more than one window per source could help, or the option to merge some
designerfiles, to make a one output.

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:37 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Nov 12, 2012 9:15 am
Posts: 130
ts-soft wrote:
this waste memory.


Seriously, with the amount of memory available on machines sold in the last decade, and considering that all mainstrean OSen released in that time, have large anounts of memory and support paging, is wasting small amounts of memory for efficiency's sake really a problem?


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:40 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2258
Location: UK
ts-soft wrote:
Creation of more than one window per source could help, or the option to merge some
designerfiles, to make a one output.

No, as it will still duplicate with the constant created outside .pbf files.
As nospam said I don't think there's so much memory wasted, too! ;)


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 8:48 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
If i create a window with 100 gadgets and 50 picture, the second windows
requires memory for 151 windowobjects in the list.

And if you use the constant for the first enumeration and i have a large enumeration before
...

Memory is not a big problem, but i do not like to waste it useless :wink:

I think, it is a good idea to find another solution.

Greetings - Thomas

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 9:06 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2258
Location: UK
ts-soft wrote:
I think, it is a good idea to find another solution.

Please do! There's no other solutions that will take into account previously created gadget constants ;)


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 9:18 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
simple add a export function to merging all open designs, enumerations outside should not have any sideeffect, if the don`t used for windows, gadgets or images.

If i have to change it by hand, i can never enhance the form at a later time :(

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Mageia 3 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 9:39 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 2401
Location: Utah, USA
Polo wrote:
ts-soft wrote:
Creation of more than one window per source could help, or the option to merge some
designerfiles, to make a one output.

No, as it will still duplicate with the constant created outside .pbf files.
As nospam said I don't think there's so much memory wasted, too! ;)

The enumerations are listed in the order of windows, gadgets, menu items, images, fonts. I have an application with 31 windows, 633 gadgets, 23 images, 180 menus, and 6 fonts. If I add one more window with a menu, an ImageGadget and a TextGadget, with the way you have set up the enumerations would mean that I would be using resources for 874 windows 877 gadgets, 878 menus, 879 images, and 880 fonts. That's a total of 4388 PB resources instead of 878. That means you are wasting memory resources exponentially not linearly.

Fred's advice is that it is better to avoid doing this.
Fred wrote:
You have to group the enum per object type for optimal performance: ie, one enum for window, one for gadget, one for toolbar etc. Using only one enum for every object will lead to holes into the internal arrays for each objects.

Fred wrote:
You put evety different object in the same enumeration. While it does work, on a big program it can be unefficient. Better use an enum per object type (one for Menu, Gadget, Window etc.). Each PB library has it's own object range.



When windows are designed for a project and they are going to be included together I would think that you could include the separate enumerations for gadgets for instance into a single enumeration. Another way that would keep the enumerations grouped separately is to simply start each enumeration with a literal value representing the count of all the previous enumerations of the same type (i.e. Enumeration 0; Enumeration 6; Enumeration 22, etc.). If the worry is that the source code for a window won't be included as part of a group then a tool that would look over the source and make modifications may help.

Freak suggested an option using macros but I think it would fall in the category of having to be customized also.


The link above is in a thread for a feature request for named enumerations. Fred said it was a good idea but we are still waiting since 2004 :cry:

This is a situation that cries out for named enumerations.

_________________
Image


Top
 Profile  
 
 Post subject: Re: #PB_Compiler_EnumerationValue
PostPosted: Wed Nov 28, 2012 10:01 pm 
Offline
Addict
Addict

Joined: Tue May 06, 2003 5:07 pm
Posts: 2258
Location: UK
I get your point, but still don't see a better way to do it.
If I use enumeration for windows/gadgets before including a .pbf file then it won't work if I don't add the flag.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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