Basically I want a service to check if a database file exists. If it does then do something (including reading said file). If not then kill itself as it cannot do what it needs to without it. Is it just a matter of a 'return' like this .
Also can a service read/write globals declared in another code module if the service has started at boot but the app itself hasn't been run yet?
Thinking that once the service has found the db that it could set the vars in the code module so it can be later read by the app when run so they are both definately using same file. Although, literally as i have just written that down thought, I guess I could have the vars declared in the service modules process globals and then activity to read them from there. That would work wouldn't it lol.
Thanks
B4X:
If File.ExternalWritable Then
If File.Exists(File.DirDefaultExternal, DatabaseName) Then
DatabaseFileDir = File.DirDefaultExternal
End If
Else
If File.Exists(File.DirInternal, DatabaseName) Then
DatabaseFileDir = File.DirInternal
Else
Return 'Die
End If
End If
SQL.Initialize(DatabaseFileDir, DatabaseName, False)
Also can a service read/write globals declared in another code module if the service has started at boot but the app itself hasn't been run yet?
Thinking that once the service has found the db that it could set the vars in the code module so it can be later read by the app when run so they are both definately using same file. Although, literally as i have just written that down thought, I guess I could have the vars declared in the service modules process globals and then activity to read them from there. That would work wouldn't it lol.
Thanks