Page 1 of 1
Enumeration #PB_Event_FirstCustomValue
Posted: Thu Dec 21, 2017 7:45 pm
by Wolfram
I use Enumeration #PB_Event_FirstCustomValue in different files which I include in one main file.
Is it normal that they have the same value?
I would expect it starts with the next higher value.
FileA.pb
Code: Select all
Enumeration #PB_Event_FirstCustomValue
#A
#B
EndEnumeration
FileB.pb
Code: Select all
Enumeration #PB_Event_FirstCustomValue
#C
#D
EndEnumeration
MainFile.pb
Code: Select all
XIncludeFile "FileA.pb"
XIncludeFile "FileB.pb"
Debug #A
Debug #B
Debug #C ;same as #A
Debug #D ;same as #B
Re: Enumeration #PB_Event_FirstCustomValue
Posted: Thu Dec 21, 2017 8:02 pm
by Josh
Like the name says, it is the first custom value
Try following:
Code: Select all
Enumeration MyEnumName #PB_Event_FirstCustomValue
#A
#B
EndEnumeration
Code: Select all
Enumeration MyEnumName
#C
#D
EndEnumeration
Maybe its a better way to write a dummy-enumeration in the mainfile and use clean named enums in the includefiles. With this, you will never have a problem if the order of the include-files is changing.:
Code: Select all
Enumeration MyEnumName #PB_Event_FirstCustomValue
EndEnumeration
Code: Select all
Enumeration MyEnumName
#A
#B
EndEnumeration
Code: Select all
Enumeration MyEnumName
#C
#D
EndEnumeration
Re: Enumeration #PB_Event_FirstCustomValue
Posted: Thu Dec 21, 2017 8:53 pm
by ts-soft
Here an example with modules!
Code: Select all
CompilerIf Defined(CommonConstants, #PB_Module) = 0
DeclareModule CommonConstants
; Form
Enumeration FormWindow
EndEnumeration
Enumeration FormGadget
EndEnumeration
Enumeration FormMenu
EndEnumeration
Enumeration FormImage
EndEnumeration
Enumeration FormFont
EndEnumeration
; Event
Enumeration EventCustom #PB_Event_FirstCustomValue
EndEnumeration
Enumeration EventTypeCustom #PB_EventType_FirstCustomValue
EndEnumeration
EndDeclareModule
Module CommonConstants
EndModule
CompilerEndIf
This is the first defined includefile.
Use for all modules, that require some of constants: