1 Introduction

Consider an application that subtracts four from every element of an array. This has a limited use – just one invocation. However, it would be more general and far more useful if we could subtract an arbitrary value from an arbitrary array. These arbitrary values are called parameters and through them we may qualify the behaviour of an application. In a sense they are like input-output channels, though instead of using logical-unit numbers they have memorable names.

PAR is a library of subroutines that makes it easier to import and export numeric, character, and logical parameters between applications and the outside world. In a contouring application, for example, these three types of parameters might be used to find the contour heights, the title for the graph, and whether or not the contours are to be annotated. Currently, PAR is only available for ADAM applications. However, this does mean that an application using PAR will be able to take advantage of features in the ADAM parameter system, such as a variety of defaulting mechanisms, a special null value, online help, and automatic type conversion. These make the application easier to use, more powerful, and more flexible.

PAR enables parameter values to be obtained, with or without constraints. Supported constraints are:

There are facilities for setting the prompt string, suggested-default values, and minimum and maximum permitted values. There is a routine that lets an application obtain new values repeatedly through the same parameter. Results may be put into parameters to be used in procedures and/or passed on to other applications. Finally, PAR can inquire the state of a parameter.

This document explains what a parameter is and the states it may reside in; it describes the usage of the PAR library with examples, progressing from the basic routines to the more sophisticated ones; and gives the linking procedures. There is a reference section containing full details of each subroutine, and classified lists of the routines.

As a consequence of PAR only being implemented using the ADAM parameter system (SUBPAR), the programmer must also write an interface file for each application. This controls the behaviour of the parameter, for example, whether it is defaulted or prompted for, where a suggested default should be obtained from, what is the default value, and where help is found. SUN/115 – the Interface Module Reference Manual – describes the syntax and facilities of interface files, and is required reading for those using PAR. Note that the examples in this document assume the ADAM implementation.

For the same reason, many error messages you see will be prefixed by ’SUBPAR:’, indicating that they emanate from the SUBPAR library.