Hello,
I have a problem with global variables:
I have 2 modules:
Main
Activity2
in Main I declare a process_global variable "iTXTSize" as follows:
and also in Main I assign a value to iTXTSize and call another Activity like this:
in Activity2 I want to use the process_global variable iTXTSize:
But I get an error:
Error description: Undeclared variable 'itxtsize' is used before it was assigned any
Why is this?
I thought that a process_global variable should be available in all modules?
thx
Heinz
I have a problem with global variables:
I have 2 modules:
Main
Activity2
in Main I declare a process_global variable "iTXTSize" as follows:
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim iTXTSize As Int
End Sub
B4X:
Sub btnSizeOK_Click
iTXTSize = txtSize.text
CallSubDelayed (Activity2,"StartProg")
End Sub
B4X:
sub StartProg()
Msgbox ("Activity2: Size="& iTXTSize,"") 'here ERROR
end sub
Error description: Undeclared variable 'itxtsize' is used before it was assigned any
Why is this?
I thought that a process_global variable should be available in all modules?
thx
Heinz