next up previous
Next: Setting Lower and Upper Limits
Up: Basic Routines
Previous: Setting the Dynamic Prompt

Setting the Dynamic Default  

When the parameter system prompts for a parameter, there is usually a suggested default given between / / delimiters, so that the user can just press <CR> to use the suggestion, or edit the suggestion. The suggested value can originate from a number of places. This includes from within an application, by setting a dynamic default.

In the following example the dynamic default for the scalar parameter SHADE depends on the value of variable COLOUR. If COLOUR is one, the dynamic default for parameter SHADE will be -1.0, and 0.0 otherwise.

    *  Set the default shading (parameter SHADE) depending on the colour.
          IF ( COLOUR .EQ. 1 ) THEN
             CALL PAR_DEF0R( 'SHADE', -1.0, STATUS )
          ELSE
             CALL PAR_DEF0R( 'SHADE', 0.0, STATUS )
          END IF

    *  Obtain the shading.
          CALL PAR_GET0R( 'SHADE', SHADE, STATUS )

Note that in ADAM applications the ppath in the interface file must begin DYNAMIC to ensure that the user of your application will be prompted with the dynamic default (see SUN/115).

The ADAM parameter system also allows the dynamic default to be used as the parameter value without prompting, through the interface file vpath (see SUN/115).

There are also routines that set the dynamic default for a vector parameter (PAR_DEF1x) and an array parameter (PAR_DEFNx). Again there are versions of this routine for the different data types listed earlier.



next up previous
Next: Setting Lower and Upper Limits
Up: Basic Routines
Previous: Setting the Dynamic Prompt

PAR Interface to the ADAM Parameter System
Starlink User Note 114
Malcolm J. Currie
Alan J. Chipperfield
1999 September 24
E-mail:ussc@star.rl.ac.uk