D ddk1 Member Licensed User Longtime User Dec 6, 2022 #1 I have a subroutine that needs to be in both an activity and a service. They are 99% the same just need tweaking based on which module they are in. Is it possible to have module (meaning a Module,Service,Activity etc) level constant that could direct compilation. Code: Copy #Region Service Attributes #const THISISMYSERVICE #End Region Sub MySub #if THISISMYSERVICE do this #end if #if THISISMYACTIVITY do that #end if
I have a subroutine that needs to be in both an activity and a service. They are 99% the same just need tweaking based on which module they are in. Is it possible to have module (meaning a Module,Service,Activity etc) level constant that could direct compilation. Code: Copy #Region Service Attributes #const THISISMYSERVICE #End Region Sub MySub #if THISISMYSERVICE do this #end if #if THISISMYACTIVITY do that #end if
Erel B4X founder Staff member Licensed User Longtime User Dec 7, 2022 #2 Not possible. Tip: don't use modules, services or activities. Switch to B4XPages. Upvote 0