; MAXTAB
;---------------------------------------------------------------
;! Returns maximum version number of named table
;# PROCEDURE UTILITY
;-----------------------------------------------------------------------
;;  Copyright (C) 2000, 2009
;;  Associated Universities, Inc. Washington DC, USA.
;;
;;  This program is free software; you can redistribute it and/or
;;  modify it under the terms of the GNU General Public License as
;;  published by the Free Software Foundation; either version 2 of
;;  the License, or (at your option) any later version.
;;
;;  This program is distributed in the hope that it will be useful,
;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;  GNU General Public License for more details.
;;
;;  You should have received a copy of the GNU General Public
;;  License along with this program; if not, write to the Free
;;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
;;  MA 02139, USA.
;;
;;  Correspondence concerning AIPS should be addressed as follows:
;;         Internet email: aipsmail@nrao.edu.
;;         Postal address: AIPS Project Office
;;                         National Radio Astronomy Observatory
;;                         520 Edgemont Road
;;                         Charlottesville, VA 22903-2475 USA
;-----------------------------------------------------------------------
;---------------------------------------------------------------
MAXTAB    LLLLLLLLLLLLUUUUUUUUUUUU CCCCCCCCCCCCCCCCCCCCCCCCCCCCC
MAXTAB:   Procedure to return highest table version number
INNAME                             Name of data file
INCLASS                            Class of data file
INSEQ              0.0      9999.0 Sequence number of data file
INDISK             0.0        15.0 Disk number of data file

          Give the two-letter code for the table type as an
          immediate argument. For example, MAXTAB('CL')

          MAXTAB is defined in the VLBAUTIL run file.
----------------------------------------------------------------
MAXTAB
Type: Procedure
Use:  MAXTAB returns the maximum version number for the specified table type.

      Type RUN VLBAUTIL before using MAXTAB for the first time.

Adverbs
  INNAME......The name of the data file. Stamdard defaults.
  INCLASS.....The class of the data file. Standard defaults.
  INSEQ.......The sequence number of the data file.
                0 => highest
  INDISK......The disk number of the disk that holds the data file
                0 => any
----------------------------------------------------------------
MAXTAB:           Procedure to look up highest table version number
Documentor:       Chris Flatters
Related Programs: GETHEAD, VLBAUTIL

MAXTAB returns the highest version number of specific table type attached to
a file. This information is often needed when writing loops to automate
operations in POPS. For example you can print out antenna tables for all of
the subarrays belonging to a data file using the following loop.

DOCRT = FALSE
NPRINT = 0
FOR INVER = 1 TO MAXTAB('AN')
    RUNWAIT ('PRTAN')
END

MAXTAB operates on the file specified using the USERID, INFILE, INCLASS,
INSEQ, and INDISK adverbs. If this file has no files of the specified type
then MAXTAB will return a value of zero.
