Next: Losing Noticeboards
Up: Examples of Using the NBS Routines
Previous: Finding out about Items
Saving and Restoring of Values
It is possible to save and restore the noticeboard data as well as just the
definition by using a different option when ending the noticeboard definition.
End the definition, writing it and the noticeboard data to file AUTOFIB.NBD.
NBS_END_DEFINITION (`AUTOFIB', ! Name of noticeboard file
`NOTICEBOARD_SAVE', ! Write noticeboard to disc
STATUS)
Restore the noticeboard definition plus data from a file and create the
noticeboard.
NBS_RESTORE_NOTICEBOARD (`AUTOFIB', ! Noticeboard name
`AUTOFIB', ! Name of noticeboard file
STATUS)
Map (find) the noticeboard.
NBS_FIND_NOTICEBOARD (`AUTOFIB', ! Noticeboard name
TOPID,STATUS) ! Top-level ID
Get the ID for an item we want to write to and put its value.
NBS_FIND_ITEM (TOPID,`CURRENT_CONFIG',CONID,STATUS)
NBS_PUT_CVALUE (CONID,0,STRING,STATUS)
Save the noticeboard to disc.
NBS_SAVE_NOTICEBOARD (TOPID, ! ID of any item on noticeboard
STATUS)
- NBS_RESTORE_NOTICEBOARD can be used to restore from a file
that contains only a definition as well as from a file that contains a
definition plus data. However if a file does not contain data the NBS__DATANOTSAVED warning status is returned -- this indicates that the
noticeboard has been created but that it is in its initial state.
- NBS_RESTORE_DEFINITION cannot be used to restore from a file
that contains data in addition to a definition. In cases where both sorts
of file are to be accessed, use NBS_RESTORE_NOTICEBOARD.
- The implementation of NBS_SAVE_NOTICEBOARD is inefficient
in that the entire definition plus data is copied to disc. Under operating
systems that support the mapping of files into virtual memory it could be
implemented using an ``update section'' call.
- NBS_SAVE_NOTICEBOARD does not create a new version of the
noticeboard definition file; it always overwrites the data in the file from
which it was restored.
Next: Losing Noticeboards
Up: Examples of Using the NBS Routines
Previous: Finding out about Items
NBS The Noticeboard System
Starlink User Note 77
D.J. Allan
11 September 1995
E-mail:ussc@star.rl.ac.uk