-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodCore.bas
30 lines (25 loc) · 1 KB
/
modCore.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Type=StaticCode
Version=4
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
'Code module
'Subs in this code module will be accessible from all modules.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub SaveSetting(SettingName As String, SettingData As String)
Main.dbConn.ExecNonQuery2("DELETE FROM Settings WHERE SettingName = ?",Array As String(SettingName))
Main.dbConn.ExecNonQuery2("INSERT INTO Settings VALUES (?, ?)",Array As String(SettingName, SettingData))
Log("SaveSetting: " & SettingName & " = " & SettingData)
End Sub
Sub LoadSetting(SettingName As String) As String
Dim SData As String
SData = Main.dbConn.ExecQuerySingleResult2("SELECT SettingData FROM Settings WHERE SettingName = ?", Array As String(SettingName))
If SData = Null Then
SData = ""
End If
Log("LoadSetting: " & SettingName & " = " & SData)
Return SData ' This will be Null (not "Null") if nothing was found
End Sub