      SUBROUTINE SET_TABLE_DESC  (table,column,offset,bitpix,dimens)
C
C----------------------------------------------------------------------
C
C.IDENTIFICATION: Subroutine SET_TABLE_DESC               
C.LIBRARY:        GENERAL
C.AUTHOR:         L.Chiappetti - IFCTR Milano
C.VERSIONS:       0.0 -  8 Sep 92 - First version 
C.VERSIONS:       1.0 - 29 Oct 92 - New error handling codes
C.PURPOSE:        set table descriptor arrays for a table column              
C.METHOD:         just put       info in BINCOMMON
C                 error code ir returned thru VOSCOMMON               
C.SYNTAX:         CALL SET_TABLE_DESC  (table,column,offset,bitpix,dimens)
C
C.PARAMETERS:     INTEGER table        XAS file number of table  file     
C                 INTEGER column       logical column number in table       
C                 INTEGER offset       physical column position in file
C                 INTEGER bitpix       column bit width (8,16,32,-32,-64)
C                 INTEGER dimens       column dimensionality
C                
C.RESTRICTIONS:   the table may generally not be open when the copy is
C                 made, so one cannot use Logical Units but must use XAS
C                 file numbers ... and make an educated guess about which
C                 will be the next XAS file number allocated ....
C.NOTES:          for convenience if a parameter has value 0 it means
C                 leave it unchanged at the previous value
C.FILES:          none
C.REFERENCES:     none
C
C----------------------------------------------------------------------
C
      INTEGER TABLE,COLUMN,OFFSET,BITPIX,DIMENS
      INCLUDE 'voscommon.inc'
      INCLUDE 'errors.inc'
      INCLUDE 'hcommon.inc'
      INCLUDE 'bincommon.inc'
C
C     test if file is in allowed range  (provisional error code)
      IF(TABLE.LE.0.OR.TABLE.GT.HCOMMON_MAXFILES)THEN
        VOSCOMMON_ERROR=XE_TABOOR
      ENDIF
C     test if column is in allowed range  (provisional error code)
      IF(COLUMN.LE.0.OR.COLUMN.GT.BINCOMMON_MAXFIELDS)THEN
        VOSCOMMON_ERROR=XE_COLOOR
      ENDIF
C-->  shall also test legal values for offset,bitpix and dimens
C     and assign error XE_ILLTABCOL
      IF(VOSCOMMON_ERROR.NE.0)RETURN
C
C
      IF(OFFSET.NE.0)BINCOMMON_OFFSET(TABLE,COLUMN)=OFFSET
      IF(BITPIX.NE.0)BINCOMMON_BITPIX(TABLE,COLUMN)=BITPIX
      IF(DIMENS.NE.0)BINCOMMON_DIMENS(TABLE,COLUMN)=DIMENS
      RETURN
      END
