' Gambas module file

Public Sub Main()

  Dim hSettings As Settings
  Dim b As New Boolean[]

  ' hSettings = New Settings("~/test.conf")
  ' hSettings["Cat1/Values"] = [False, False, False, False]
  ' hSettings.Save
  
  hSettings = New Settings("~/.i-nex/i-nex.conf")
  b = hSettings["Cat1/Values"]
  b[1] = True
  hSettings["Cat1/Values"] = b
  hSettings.Save
  
  ' Settings.Save hSettings["localhost/Login"] = ""
  ' hSettings["Charlie/Login"] = "Toto"
  ' Dump(hSettings)
  ' hSettings.Save()
  ' ' clear and save it
  ' hSettings.Clear("Charlie")   ' don't work, found, removed
  ' Dump(hSettings)
  ' hSettings.Save() ' on save reloaded by "Sub Load()" from file
  
End

Private Sub Dump(hSettings As Settings)

  Dim sSlot As String
  Dim sKey As String

  For Each sSlot In hSettings.Keys
    
    Print "["; sSlot; "]"
    For Each sKey In hSettings.Keys[sSlot]
      Print sKey; "="; hSettings[sSlot &/ sKey]
    Next
    
  Next
  Print

End

