' Define the global map
Sub Process_Globals
' Global Map holding the settings
Public SettingsMap As Map
' Define the settings file which is read by the global settings map
Public SettingsFile As String = "settings.txt"
End Sub
'Check if the settings file exists, else create a new file
If File.Exists(File.DirApp, SettingsFile) Then
SettingsMap = File.ReadMap(File.DirApp, SettingsFile)
Else
'Create a new map and save
SettingsMap = CreateMap ("Sortlist": "False", "ButtonTitles": "False")
File.WriteMap(File.DirApp, SettingsFile, SettingsMap)
End If
' Get the settings from the global map.
' IMPORTANT: Use exact case for the keys
Log("Get setting...")
If SettingsMap.Get("ButtonTitles") = False Then
btnInsert.Text = ...
End If
Make updates by using like SettingsMap.Put("ButtonTitles", False)
' If changes to the settings are made, save the changes to the global map
File.WriteMap(File.DirApp, SettingsFile, SettingsMap)