Using Setting Numbers
|Top Previous Next|
Up until now we referred to settings by their names. It is also possible to call settings by their number. Settings are numbered in the order of their appearance in the setting configurator. Settings are counted from 0.
Here is a neat example where we read (the first member of) every available setting. Notice how the error condition (EN_STG_STATUS_UNKNOWN) is used to exit the loop:
Of course, the above example can be implemented in a more conventional way using stg_get_num_settings():
So, how does the STG library know when to interpret your input as a setting name or number? Simple! If it starts with a digit (0-9), then this is a setting number, otherwise it is a setting name. Names, therefore, can't start with a digit.