Next: Coding rules
Up: Code Standards
Previous: Code Standards
General
Normal application programs written for MIDAS should be
structured so that the main program handles parameter input/output and
initiation of data while all computations and algorithms should be
placed in subroutines. This gives the general rules for applications:
- Access to MIDAS keywords must be done in the main program only.
- All MIDAS files (e.g. frames, tables and catalogues)
must be created, opened and/or closed in the main program only.
- Direct I/O is not allowed e.g. read/write on terminals.
All access to devices must be done through the
ST/SC-interfaces.
- No operating system related calls are allowed.
- No calls to operating system utilities are allowed.
- All access to MIDAS data structures must be done through the
ST/TB- or SC/TC-interfaces.
- No calls to external libraries (e.g. NAG).
In general, algorithms should be separated from routines that access data.
This makes it easier to re-use such algorithms in other applications.