How the get the (unknown keys) from a Settings file?

Terminology of Keys and "Slot" for the group of keys in a settings file
taken from documentation;

This gives the names of the slots:


  Dim SettingsToImport As New Settings(User.Home &/
".config/gambas3/gambas3.conf")

  Dim sKeySlot As String
  Dim iSlotCounter As Integer

  For Each sKeySlot In SettingsToImport.Keys
    Debug sKeySlot
    Inc iSlotCounter
  Next
  Debug "  - - - - " & iSlotCounter


Works fine, gives me all the slotnames, and the count of e.g.23:

> Editor
> FColorChooser
> FConnectionEditor
...
> gb.form.mdi/FShortcut
> gb.form.mdi/FToolbarConfig
> gb.form.mdi/Toolbars/main
>    - - - - 23

Next step; I want to have the keys themselves.  But how? (assuming I do
not know the keynames)


  Dim SettingsToImport As New Settings(User.Home &/
".config/gambas3/gambas3.conf")

  Dim sKey As String
  Dim iKeyCounter As Integer

  Dim hSettingsKeys As _Settings_Keys  ' what I found in gb.settings docum.

  For Each sKeySlot In SettingsToImport.Keys
    Debug sKeySlot
    Inc iSlotCounter

    hSettingsKeys = SettingsToImport.Keys[sKeySlot]  ' docum says
hSettings.Keys [ Parent As String ]

    For Each sKeySlot In hSettingsKeys
      Inc iKeyCounter
      Debug iKeyCounter & ": " & sKey
    Next

  Next



Doesn't crash, doesn't freeze, but gives the output:

> Editor
> 1: Font
> 2: KeywordsUseUpperCase
> KeywordsUseUpperCase


That's all, it stops.

(I want to import a Settings file, not use it for my app itself; I know
how to save and use settings for my app).

This in Gambas 3.4.1 on OpenSuse 13.1/KDE


WiG.




------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to