Code: Select all
DeclareModule Cars
Global.i LastEnumeration = 0
EndDeclareModule
Module Cars
EndModule
DeclareModule Ferrari
UseModule Cars
Debug LastEnumeration
Enumeration LastEnumeration
#a
#b
#c
EndEnumeration
EndDeclareModule
Module Ferrari
LastEnumeration + #PB_Compiler_EnumerationValue
Debug "Ferrari " + Str(LastEnumeration)
EndModule
DeclareModule Porche
UseModule Cars
Debug LastEnumeration
Enumeration LastEnumeration
#a
#b
#c
EndEnumeration
EndDeclareModule
Module Porche
LastEnumeration + #PB_Compiler_EnumerationValue
Debug "Porche " + Str(LastEnumeration)
EndModule
Debug Ferrari::#a
Debug Porche::#cI've (sort of, since I'd like to use :: syntax for my enumerations, which would be super fantastic for code readability!) here -> http://www.forums.purebasic.com/english ... 87#p424695 but I'm still wondering what's wrong with my code.
BTW, if i "hardcode" a number after enumeration, it works as expected. So I guess this has nothing to do with modules but with a fact you can't assign variable to enumeration, right?
:punishing myself for being stupid:
Code: Select all
DeclareModule Ferrari
Enumeration #PB_Compiler_EnumerationValue
#a
#b
#c
EndEnumeration
EndDeclareModule
Module Ferrari : EndModule
DeclareModule Porche
Enumeration #PB_Compiler_EnumerationValue
#a
#b
#c
EndEnumeration
EndDeclareModule
Module Porche : EndModule
Debug Ferrari::#a
Debug Porche::#c



