[Gambas-user] Concurrent gb.settings

T Lee Davidson t.lee.davidson at gmail.com
Mon Apr 30 20:09:53 CEST 2018


The slot is to group related key/value pairs together.

If you have:
Public Sub Form_Close()
  ' Save window settings when application closes
  Settings["Window/Top"] = Me.Top
  Settings["Window/Left"] = Me.Left
  Settings["Window/Height"] = Me.Height
  Settings["Window/Width"] = Me.Width
End

The saved settings file would look something like the following:
[Window]
Top = 13
Left = 18
Height = 154
Width = 235

To save a setting, the syntax is Settings["SLOT/KEY"] = VALUE

When retrieving a setting, you can set a default value in case the setting is not found in the file.
To retrieve a setting, the syntax is VALUE = Settings["SLOT/KEY", DEFAULT_VALUE]


See http://gambaswiki.org/wiki/comp/gb.settings/settings


-- 
Lee


On 04/29/2018 04:53 PM, PICCORO McKAY Lenz wrote:
> thanks  for clarification Benoit, great!
> 
> and about the slot line, which begins with a '|[|' character, and ends with a '|]|' character.
> 
> wiki said: "This groups key/value lines together in a slot" but due a language barrier i cannot understand that in a gambas
> example code
> 
> i have sne d apreviously mail about that!
> 


More information about the User mailing list