-
Notifications
You must be signed in to change notification settings - Fork 86
settings init
Chris Petersen edited this page Oct 16, 2014
·
1 revision
settings-init initializes settings table with default setting values (found in defaults which is list of lists) and then overrides these with any settings found in config/settings.scm. The defaults list can be empty if all required settings are already stored in a file, but generally no settings file will exist when the app is first built.
Parameter | Description |
---|---|
defaults | A list of key:value pairs created with cons. E.g. (list (cons "key "value")) |
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))
-
- accelerometer
- alist
- audio
- audioaux
- base64
- btle-scan
- camera
- cdb
- cgi
- config
- csv
- curl
- digest
- dmtx
- download
- eventloop
- fcgi
- fft
- generalized-arrays
- gps
- graph
- gyro
- hidapi
- hpdf
- html
- httpsclient
- hybridapp
- json
- lmdb
- ln_core
- ln_glcore
- ln_glgui
- ln_store
- localization
- localization_gui
- localnotification
- magnetometer
- mdns
- mqtt
- mqtt-store
- multitouch
- oauth
- orientation
- p256ecdsa
- png
- portaudio
- pregexp
- pressure
- prime
- pushnotification
- redcap
- rsa
- rtaudio
- rupi
- rotation
- sanestring
- scheduler
- serial
- sets
- settings
- simplexnoise
- sqlite
- ssax
- syntax-case
- timestamp
- ttf
- uiform
- url
- uuid
- vibrate
- videoplayer
- watchdog
- website
- xml
- zip