Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
scardc

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

     SCARDC ( Set the cardinality of a character cell )

     SUBROUTINE SCARDC ( CARD, CELL )

Abstract

     Set the cardinality of a character cell.

Required_Reading

     CELLS

Keywords

     CELLS

Declarations

     IMPLICIT NONE

     INTEGER               LBCELL
     PARAMETER           ( LBCELL = -5 )

     INTEGER               CARD
     CHARACTER*(*)         CELL   ( LBCELL:* )

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     CARD       I   Cardinality of (number of elements in) the cell.
     CELL       O   The cell.

Detailed_Input

     CARD     is the cardinality of (number of elements in) the
              cell.

Detailed_Output

     CELL     is a cell.


              On output, the cardinality of the cell is CARD.

Parameters

     None.

Exceptions

     1)  If the cardinality value supplied is less than 0 or greater
         than the cell size, the error SPICE(INVALIDCARDINALITY) is
         signaled.

Files

     None.

Particulars

     The set cardinality (SCARDC, SCARDD, and SCARDI) and set size
     (SSIZEC, SSIZED, and SSIZEI) routines are typically used to
     initialize cells for subsequent use. Since all cell routines
     expect to find the size and cardinality of a cell in place,
     no cell can be used until both have been set.

     The set cardinality routines are also used by library routines
     which manipulate cells (including set and window routines) to
     reset the cardinalities of cells as they gain or lose elements.

Examples

     In the example below, the size and cardinality of the character
     cell FRED are set in the main module of the program FLNSTN.
     Both are subsequently retrieved, and the cardinality changed,
     in one of its subroutines, WILMA.

           PROGRAM FLNSTN

           CHARACTER*30     FRED ( LBCELL:100 )
            .
            .
           CALL SSIZEC ( 100, FRED )
            .
            .
           CALL WILMA ( FRED )
            .
            .
           STOP
           END


           SUBROUTINE WILMA ( FRED )

           CHARACTER*(*)      FRED  ( LBCELL:* )
           INTEGER            SIZE
           INTEGER            CARD

           INTEGER            CARDC
           INTEGER            SIZEC
            .
            .
           SIZE = SIZEC ( FRED )
           CARD = CARDC ( FRED )
            .
            .
           CALL SCARDC ( MIN ( SIZE, CARD ), FRED )
           CALL EXCESS ( CARD-SIZE, 'cell' )
            .
            .
           RETURN
           END

Restrictions

     None.

Literature_References

     None.

Author_and_Institution

     N.J. Bachman       (JPL)
     C.A. Curzon        (JPL)
     J. Diaz del Rio    (ODC Space)
     W.L. Taber         (JPL)
     I.M. Underwood     (JPL)

Version

    SPICELIB Version 1.1.0, 20-AUG-2021 (JDR)

        Added IMPLICIT NONE statement.

        Edited the header to comply with NAIF standard.

    SPICELIB Version 1.0.1, 10-MAR-1992 (WLT)

        Comment section for permuted index source lines was added
        following the header.

    SPICELIB Version 1.0.0, 31-JAN-1990 (CAC) (WLT) (IMU) (NJB)
Fri Dec 31 18:36:45 2021