Seite 1 von 1

Enumeration von #PB_Event_FirstCustomValue für Module

Verfasst: 11.09.2014 22:54
von hjbremer
Da in der Hilfe nur mäßig beschrieben

hier mal ein Weg um CustomValues für mehrere Module zu numerieren

basiert auf benannte Enumeration und einem Common Modul. siehe Hilfe

Code: Alles auswählen


CompilerIf Defined(Common_Event_CustomValue, #PB_Module) = #False
   
   DeclareModule Common_Event_CustomValue
      
      Enumeration PB_Event_CustomValue
         #firstevent = #PB_Event_FirstCustomValue
      EndEnumeration
      
      Enumeration PB_EventType_CustomValue
         #firsteventtype = #PB_EventType_FirstCustomValue
      EndEnumeration
      
   EndDeclareModule
   
   Module Common_Event_CustomValue
   EndModule 
   
CompilerEndIf

DeclareModule test1   
   UseModule Common_Event_CustomValue
   
   Enumeration PB_Event_CustomValue
      #my_test1_Event_1
      #my_test1_Event_2
   EndEnumeration
   
   Enumeration PB_EventType_CustomValue
      #my_test1_Eventtype_1
      #my_test1_Eventtype_2
   EndEnumeration  
   
EndDeclareModule

Module test1
EndModule


DeclareModule test11
   UseModule Common_Event_CustomValue
   
   Enumeration PB_Event_CustomValue
      #my_test11_Event_1
      #my_test11_Event_2
   EndEnumeration
   
   Enumeration PB_EventType_CustomValue
      #my_test11_Eventtype_1
      #my_test11_Eventtype_2
   EndEnumeration 
   
EndDeclareModule

Module test11   
EndModule

UseModule test1
UseModule test11

Debug #my_test1_Event_1
Debug #my_test1_Event_2
Debug #my_test11_Event_1
Debug #my_test11_Event_2

Debug #my_test1_Eventtype_1
Debug #my_test1_Eventtype_2
Debug #my_test11_Eventtype_1
Debug #my_test11_Eventtype_2

Re: Enumeration von #PB_Event_FirstCustomValue für Module

Verfasst: 12.09.2014 21:19
von hjbremer
kleine Verbesserung mit CompilerIF

falls Commonmodul bereits irgendwo bereits vorhanden

siehe oben.