I have a "Main" module where I have
Then I have another module called "Terminal" where I also want to use usocket.
Any reference to usocket in the Terminal module gives an error-
"Error description: Undeclared variable 'usocket' is used before it was assigned any value."
I tried to initialize usocket in Terminal/Activity_Create but the same error.
I understood that a variable declared in Process_Global was available in all modules without having to declare it again so there is something I don't understand about this.
pageID which is also declared in Sub Process_Globals can be used in another module as I expected.
Can someone tell me what is different about certain variable or objects which causes this problem and what I should do to get round it?
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim pageID As Int 'I can access pageID from another module
Dim usocket As UDPSocket 'I cannot access usocket from another module
.
.
End Sub
Then I have another module called "Terminal" where I also want to use usocket.
Any reference to usocket in the Terminal module gives an error-
"Error description: Undeclared variable 'usocket' is used before it was assigned any value."
I tried to initialize usocket in Terminal/Activity_Create but the same error.
I understood that a variable declared in Process_Global was available in all modules without having to declare it again so there is something I don't understand about this.
pageID which is also declared in Sub Process_Globals can be used in another module as I expected.
Can someone tell me what is different about certain variable or objects which causes this problem and what I should do to get round it?