I have the following in my first activity (Main)
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim DBFileName As String: DBFileName = "Diary.db"
Dim DBFileDir As String: DBFileDir = File.DirDefaultExternal
Dim DBTableName As String: DBTableName = "DEntries"
Dim AppName As String: AppName = "Diary"
Dim SQL1 As SQL
End Sub
The second activity (BrowseData) intended to be called by a button press in the first contains the following.
Query = "Select Dt, Weather, Entry from " & DBTableName & " order by Dt"
This refuses to compile and gives
Error parsing program.
Error description: Undeclared variable 'dbtablename' is used before it was assigned any value.
The variable SQL1 gives a similar error, although both are defined as Global variables right at the start of the program.
I've read the tutorial on Android process and activities and I assume the problem arises because Main is not compiled first. However, I can't see how to ensure that it is. Surely Global variables don't have to be defined in each module, otherwise they aren't really Global...?
Thanks for any help.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim DBFileName As String: DBFileName = "Diary.db"
Dim DBFileDir As String: DBFileDir = File.DirDefaultExternal
Dim DBTableName As String: DBTableName = "DEntries"
Dim AppName As String: AppName = "Diary"
Dim SQL1 As SQL
End Sub
The second activity (BrowseData) intended to be called by a button press in the first contains the following.
Query = "Select Dt, Weather, Entry from " & DBTableName & " order by Dt"
This refuses to compile and gives
Error parsing program.
Error description: Undeclared variable 'dbtablename' is used before it was assigned any value.
The variable SQL1 gives a similar error, although both are defined as Global variables right at the start of the program.
I've read the tutorial on Android process and activities and I assume the problem arises because Main is not compiled first. However, I can't see how to ensure that it is. Surely Global variables don't have to be defined in each module, otherwise they aren't really Global...?
Thanks for any help.