-
Notifications
You must be signed in to change notification settings - Fork 3
/
M_omDefaultFunctions.def
46 lines (40 loc) · 1.68 KB
/
M_omDefaultFunctions.def
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Option Compare Database
Option Explicit
Public gSystemDefaults As New omDefaults
Public gDefaults As New omDefaults
Public Function GetDefault(Name As String) As Variant
omDefaultFunctions.Initialize
GetDefault = gDefaults.Load(Name)
End Function
Public Function SaveDefault(Name As String, Value As Variant)
omDefaultFunctions.Initialize
gDefaults.Save Name, Value
End Function
Public Function SaveSystemDefault(Name As String, Value As Variant)
omDefaultFunctions.Initialize
gSystemDefaults.Save Name, Value
End Function
Public Function GetSystemDefault(Name As String) As Variant
omDefaultFunctions.Initialize
GetSystemDefault = gSystemDefaults.Load(Name)
End Function
Public Sub Initialize(Optional Reset As Boolean = False)
If omObjectFunctions.IsNothing(gSystemDefaults) Or Reset Or Not gSystemDefaults.Initialized Then
gSystemDefaults.Mode = LocalMode
End If
If omObjectFunctions.IsNothing(gDefaults) Or Reset Or Not gDefaults.Initialized Then
gDefaults.Mode = serverMode
End If
gSystemDefaults.Development = gDevelopmentMode
gDefaults.Development = gDevelopmentMode
End Sub
Public Sub CreateDefaultTables()
'omTableFunctions.CreateTable "omSysDefaults", "Id", dbLong, True
'omTableFunctions.AddField "omSysDefaults", "Name", dbText
'omTableFunctions.AddField "omSysDefaults", "Value", dbMemo
'omTableFunctions.AddField "omSysDefaults", "ModifyDate", dbDate
'omTableFunctions.CreateTable "omDefaults", "Id", dbLong, True
'omTableFunctions.AddField "omDefaults", "Name", dbText
'omTableFunctions.AddField "omDefaults", "Value", dbMemo
'omTableFunctions.AddField "omDefaults", "ModifyDate", dbDate
End Sub