### SETEXT

Manipulates the contents of a specified NDF extension

#### Description:

This task enables the contents of a specified NDF  extension to be edited. It can create a new extension or delete an existing one, can create new scalar components within an extension, or modify or display the values of existing scalar components within the extension. The task operates on only one extension at a time, and must be closed down and restarted to work on a new extension.

The task may operate in one of two modes, according to the LOOP parameter. When LOOP=FALSE only a single option is executed at a time, making the task suitable for use from an ICL procedure. When LOOP=TRUE several options may be executed at once, making it easier to modify several extension components interactively in one go.

#### Usage:

setext ndf xname option cname $\left\{\right\$
ok ctype=? shape=? ok newname=? xtype=?

option

#### Parameters:

The name of component (residing within the extension) to be examined or modified. It is only accessed when OPTION="Erase", "Get", "Put", or "Rename".
The type of component (residing within the extension) to be created. Allowed values are "LITERAL", "_LOGICAL", "_DOUBLE", "_REAL", "_INTEGER", "_CHAR", "_BYTE", "_UBYTE", "_UWORD", "_WORD". The length of the character type may be defined by appending the length, for example, "_CHAR$\ast$32" is a 32-character component. "LITERAL" and "_CHAR" generate 80-character components. CTYPE is only accessed when OPTION="Put".
The value(s) for the component. Each value is converted to the appropriate data type for the component. CVALUE is only accessed when OPTION="Put". Note that for an array of values the list must be enclosed in brackets, even in response to a prompt. For convenience, if LOOP=TRUE, you are prompted for each string.
LOOP=FALSE requests that only one operation be performed. This allows batch and non-interactive processing or use in procedures. LOOP=TRUE makes SETEXT operate in a looping mode that allows several modifications and/or examinations to be made to the NDF for one activation. Setting OPTION to "Exit" will end the looping. [TRUE]
##### NDF = NDF (Update)
The NDF to modify or examine.
The new name of a renamed extension component. It is only accessed when OPTION="Rename".
This parameter is used to seek confirmation before a component is erased or overwritten. A TRUE value permits the operation. A FALSE value leaves the existing component unchanged. This parameter is ignored when LOOP=FALSE.
The operation to perform on the extension or a component therein. The recognised options are listed below.
 "Delete" –- Delete an existing NDF extension. –- Erase a component within an NDF extension –- Exit from the task (when LOOP=TRUE) –- Display the value of a component within an NDF extension. The component must exist. –- Change the value of a component within an NDF extension or create a new component. –- Renames a component. The component must exist. "Select"] –- Selects another extension. If the extension does not exist a new one is created. This option is not allowed when LOOP=FALSE.

The suggested default is the current value, except for the first option where there is no default.

##### SHAPE( ) = _INTEGER (Read)
The shape of the component. Thus 3,2 would be a two-dimensional object with three elements along each of two lines. 0 creates a scalar. The suggested default is the shape of the object if it already exists, otherwise it is the current value. It is only accessed when OPTION="Put".
The name of the extension to modify.
The type of the extension to create. The suggested default is the current value or "EXT" when there is no current value.

#### Examples:

setext hh50 fits delete noloop
This deletes the FITS extension in the NDF called hh50.
setext myndf select xtype=mytype noloop
This creates the extension MYEXT of data type MYTYPE in the NDF called myndf.
setext xname=ccdpack ndf=abc erase cname=filter noloop
This deletes the FILTER component of the CCDPACK extension in the NDF called abc.
setext abc ccdpack put cname=filter cvalue=B ctype=_char noloop
This assigns the character value "B" to the FILTER component of the CCDPACK extension a the NDF called abc.
setext virgo plate put cname=pitch shape=2 cvalue=[32,16] ctype=_byte noloop
This sets the byte two-element vector of component PITCH of the PLATE extension in the NDF called virgo. The first element of PITCH is set to 32 and the second to 16.
setext virgo plate rename cname=filter newname=waveband noloop
This renames the FILTER component of the PLATE extension in the NDF called virgo to WAVEBAND.

#### Notes:

• The "Put" option allows the creation of extension components with any of the primitive data types.

• The task creates the extension automatically if it does not exist and only allows one extension to be modified at a time.