Hello!
I know this topic has been beaten to death here, I've tried all of the things that people have suggested but still cannot access any global variables defined in the main activity Process_Global section from anywhere else other than the main module. I have include some sample code with one variable as an example.
code:
Main: ' this is code in main module
Sub Process_Globals
Dim TestVar As String: TestVar = "1234" ' test global variable
'
' other stuff goes here....
End Sub
My second code module looks similiar to this:
CommSubs: ' this is the name of my second module
Sub TestSub ' this subroutine just for testing compiler
Dim LocalVar As String ' define a local variable
LocalVar = TestVar ' this generates a compiler error
' note after I comment out the previous line the next line is active:
LocalVar = Main.TestVar ' this also generates the same compiler error
'
End Sub
No matter what I've tried I cannot reference the globals in the second module so I had to cut and paste the code into the main module and everything works as expected. I thought that prefixing the variable with
Main would have fixed my problem. I've tried Strings, Int's and upper and lower case main prefixes but all react the same. I am running the latest IDE v1.17 and not sure what I should do since I have several dozen variables defined in my main module that have to be accessed by other code modules. Passing variables to subroutines in other modules works as expected but all of the variables defined in my main module are psuedo constants like file names, etc. Sorry for the way the code looks on here. I don't know how to use the code tags yet.
Any help would greatly be appreciated!
thx,
Ray
I know this topic has been beaten to death here, I've tried all of the things that people have suggested but still cannot access any global variables defined in the main activity Process_Global section from anywhere else other than the main module. I have include some sample code with one variable as an example.
code:
Main: ' this is code in main module
Sub Process_Globals
Dim TestVar As String: TestVar = "1234" ' test global variable
'
' other stuff goes here....
End Sub
My second code module looks similiar to this:
CommSubs: ' this is the name of my second module
Sub TestSub ' this subroutine just for testing compiler
Dim LocalVar As String ' define a local variable
LocalVar = TestVar ' this generates a compiler error
' note after I comment out the previous line the next line is active:
LocalVar = Main.TestVar ' this also generates the same compiler error
'
End Sub
No matter what I've tried I cannot reference the globals in the second module so I had to cut and paste the code into the main module and everything works as expected. I thought that prefixing the variable with
Main would have fixed my problem. I've tried Strings, Int's and upper and lower case main prefixes but all react the same. I am running the latest IDE v1.17 and not sure what I should do since I have several dozen variables defined in my main module that have to be accessed by other code modules. Passing variables to subroutines in other modules works as expected but all of the variables defined in my main module are psuedo constants like file names, etc. Sorry for the way the code looks on here. I don't know how to use the code tags yet.
Any help would greatly be appreciated!
thx,
Ray