next up previous contents index
Next: Interrupting Procedures Up: MIDAS Command Language Previous: Conditional StatementsBranching

Special Functions

 

Special functions may be used with the command COMPUTE/KEYWORD. The currently supported functions are listed in the following table (on the next page). Note, that arg1, arg2 may either be the name of a keyword, the contents of which are used, or a constant. Character constants have to be enclosed in double quotes to distinguish them from a keyword name. On--line help for these functions is available via HELP COMPUTE/KEYWORD.

  
Table: Special Functions available for operations on keywords


As an example we want to to display the header of a FITS file stored on disk (without converting the data), the FITS file name may be entered with or without the file extension .mt; if not given we append the type inside the procedure:

!+
! Example 16, MIDAS procedure exa16.prg
!+
DEFINE/PARAM P1 ? ? "Enter FITS file name:"
!
DEFINE/LOCAL INA/C/1/80 " " all ! that fills all elements of INA with blanks
DEFINE/LOCAL K/I/1/2 0,0
!
K = M$INDEX(P1,".mt") ! test, if type of FITS file entered
IF K .LT. 2 THEN
WRITE/KEYW INA P1.mt ! if not, append type
ELSE
WRITE/KEYW INA P1 ! if yes, no need to append type
ENDIF
INTAPE/FITS 1 midd ina fnn | $more

The MIDAS commands @@ exa16 test as well as @@ exa16 test.mt will both display the header of the FITS file test.mt. Note, that this procedure will display the header in a user friendly way, i.e. one screen at a time (and only work for Unix).
One of the MIDAS verification procedures, verify3.prg shows the usage of all currently available functions. Enter @ vericopy to copy this procedure into your current directory (also the usage of verify3 will be shown then).



next up previous contents index
Next: Interrupting Procedures Up: MIDAS Command Language Previous: Conditional StatementsBranching



Rein Warmels
Mon Jan 22 12:06:29 MET 1996