Next: , Previous: Create a Dictionary, Up: Dictionaries

6.2 Setting Dictionary Values

When building an SRecode based application, you will need to setup your dictionary values yourself. There are several utility functions for this.

In the simplest form, you can associate a string with a variable.

— Function: srecode-dictionary-set-value dict name value

In dictionary dict, set name to have value.

For section macros, you can have alternate values. A section can either be toggled as visible, or it can act as a loop.

— Function: srecode-dictionary-show-section dict name

In dictionary dict, indicate that the section name should be exposed.

— Function: srecode-dictionary-add-section-dictionary dict name show-only

In dictionary DICT, add a section dictionary for section macro NAME. Return the new dictionary.

You can add several dictionaries to the same section entry. For each dictionary added to a variable, the block of codes in the template will be repeated.

If optional argument SHOW-ONLY is non-nil, then don't add a new dictionary if there is already one in place. Also, don't add FIRST/LAST entries. These entries are not needed when we are just showing a section.

Each dictionary added will automatically get values for positional macros which will enable SECTIONS to be enabled.

first
The first entry in the table.
notfirst
Not the first entry in the table.
last
The last entry in the table
notlast
Not the last entry in the table.

Adding a new dictionary will alter these values in previously inserted dictionaries.