settings set! - part-cw/lambdanative GitHub Wiki
(settings-set! key value)
settings-set! sets one of the settings and saves all settings to the file.
Parameter | Description |
---|---|
key | The settings key |
value | The value to be stored |
Example
Example 1: Initialize the settings file and retrieve and store some settings values
;; Make sure we have a config directory
(let ((configdirectory (string-append (system-directory) (system-pathseparator) "config")))
(if (not (file-exists? configdirectory))
(create-directory configdirectory)))
;; Initialize the settings file
(settings-init (list (cons "Localization" 1)
(cons "SensorLocations" (list "Ear" "Hand" "Foot"))))
;; Retrieve and store some settings values
(display (settings-ref "Localization")) (newline)
(define username "demo")
(if (string? username) (settings-set! "Username" username))