#PB_Compiler_EnumerationValue

You need some new stunning features ? Tell us here.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: #PB_Compiler_EnumerationValue

Post by ts-soft »

Polo wrote:If I use enumeration for windows/gadgets before including a .pbf file then it won't work if I don't add the flag.
Most people don't use enumeration for windows/gadgets before including your form :wink:
but if the do, the have to set the number for beginning your enumeration or self merge the
enumerations.

I think, the best is to create one commonfile with Enumerations for all GUIs, that should
work in one project.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
nospam
Enthusiast
Enthusiast
Posts: 130
Joined: Mon Nov 12, 2012 9:15 am

Re: #PB_Compiler_EnumerationValue

Post by nospam »

ts-soft wrote:Memory is not a big problem, but i do not like to waste it useless :wink:
Whatever you do, don't get any aspirations to work for Micro$oft :mrgreen:
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: #PB_Compiler_EnumerationValue

Post by Polo »

ts-soft wrote:
Polo wrote:If I use enumeration for windows/gadgets before including a .pbf file then it won't work if I don't add the flag.
Most people don't use enumeration for windows/gadgets before including your form :wink:
In big projects, it's likely they will, I'm still unsure on what to do with that. I'll give it some thoughts! ;)
User avatar
HeX0R
Addict
Addict
Posts: 1204
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: #PB_Compiler_EnumerationValue

Post by HeX0R »

A redefine()-CompilerDirective would come in handy, then you could do it like this:

Code: Select all

CompilerIf Defined(PB_ENUMERATION_GADGETS, #PB_Constant) = 0
	#PB_ENUMERATION_GADGETS = 0
CompilerEndIf


;Gadgets
Enumeration #PB_ENUMERATION_GADGETS
	#Text_0
	#Text_1
EndEnumeration

ReDefine(#PB_ENUMERATION_GADGETS, #PB_Compiler_EnumerationValue)
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: #PB_Compiler_EnumerationValue

Post by ts-soft »

Or the Compiler set a constant like this:

Code: Select all

Enumeration #NextWindowValue
 #frmMain
 #frmDialog
EndEnumeration

Enumeration #NextGadgetValue
  #btnOkay
  #btnCancel
EndEnumeration
Should not a big problem for the compiler to look at the objectmanager to set the value.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply