I am trying to develop some level of module dependence check within my project.
I was thinking that I could add a compiler constant in the module I want to ensure was loaded, i.e.
#Const ModuleX_Loaded = True
And then, in the module that I want to ensure I only add code for if the required module is loaded, I could add the following code:
#If ModuleX_Loaded = True Then
.. some code to make use of the elements in ModuleX
#Else
.. some replacement code or some error code to identify the ModuleX is missing
#End If
What I find, though, is that the #If statement always evaluates to False, and I get the Else code executed.
Do you have any ideas - or specific information about the Scope of a compiler constant, which, according to Microsoft Learn, should be global?
-Jan
I was thinking that I could add a compiler constant in the module I want to ensure was loaded, i.e.
#Const ModuleX_Loaded = True
And then, in the module that I want to ensure I only add code for if the required module is loaded, I could add the following code:
#If ModuleX_Loaded = True Then
.. some code to make use of the elements in ModuleX
#Else
.. some replacement code or some error code to identify the ModuleX is missing
#End If
What I find, though, is that the #If statement always evaluates to False, and I get the Else code executed.
Do you have any ideas - or specific information about the Scope of a compiler constant, which, according to Microsoft Learn, should be global?
-Jan