Controlling Your Device Through Settings

Top  Previous  Next

Like the Windows registry, the STG library may be used to provide a well-organized, persistent storage for your device's operational parameters. In many cases, settings will be the backbone of your Tibbo BASIC/C project, as numerous other libraries utilize settings for parameter (variable) storage.

One less obvious and very powerful concept of setting usage is that settings can serve as transit points for controlling and/or monitoring the device. That is, writing to a setting can cause the related code to be executed after the new value is set (post-set), and this code will put the new value "into action". Reading a setting can cause the value of the setting to be updated first (pre-get), and only then returned to the caller.

In other words, it is possible to change your device's operation (behavior, mode, etc.) just by writing a new value to a setting. It is also possible to get the current device status just by reading a setting's value. This is a very powerful concept. Master it, and you will be able to create clean, structured applications.

Using Pre-gets and Post-sets continues this discussion.