idlastro / FITS I/O: FXMOVE

[Source code]

NAME
FXMOVE
PURPOSE
Skip to a specified extension number or name in a FITS file
CALLING SEQUENCE
STATUS=FXMOVE(UNIT, EXT, /Silent)
STATUS=FXMOVE(UNIT, EXTNAME, /Silent, EXT_NO=, ERRMSG= )
INPUT PARAMETERS
UNIT     = An open unit descriptor for a FITS data stream.
EXTEN   = Number of extensions to skip.
                         or
        Scalar string giving extension name (in the EXTNAME keyword)           
OPTIONAL INPUT PARAMETER
/SILENT - If set, then any messages about invalid characters in the 
          FITS file are suppressed.
OPTIONAL OUTPUT PARAMETER
ERRMSG  = If this keyword is present, then any error messages will be
          returned to the user in this parameter rather than
          depending on the MESSAGE routine in IDL.  If no errors are
          encountered, then a null string is returned.
EXT_NO - Extension number, scalar integer, useful if the user supplied 
         an extension name in the EXTEN parameter
RETURNS
0 if successful.
1 if an error is encountered.
COMMON BLOCKS
None.
SIDE EFFECTS
Repositions the file pointer.
PROCEDURE
Each FITS header is read in and parsed, and the file pointer is moved
to where the next FITS extension header until the desired
extension is reached.
PROCEDURE CALLS
FXPAR(), MRD_HREAD, MRD_SKIP
MODIFICATION HISTORY
Extracted from FXPOSIT 8-March-2000 by T. McGlynn
Added /SILENT keyword  14-Dec-2000 by W. Landsman
Save time by not reading the full header  W. Landsman   Feb. 2003
Allow extension name to be specified, added EXT_NO, ERRMSG keywords
   W. Landsman  December 2006
Make search for EXTNAME case-independent  W.Landsman March 2007 
Avoid round-off error for very large extensions N. Piskunov Dec 2007
Assume since V6.1 (/INTEGER keyword available to PRODUCT() ) Dec 2007
Capture error message from MRD_HREAD (must be used with post-June 2009
  version of MRD-HREAD)   W. Landsman  July 2009