next up previous contents index
Next: GKSGRAL and GKSGRAL-3D Up: GKSPACK Previous: GKSPACK Error Messages

GKSPACK Example Program

The following complete program illustrates the use of some routines available in GKSPACK:

      PROGRAM DEMOC1
*
*  Include file defines GKSGRAL workstation types
*
      INCLUDE  'GKS$GTSDEV'
      CHARACTER*80 REPLY
      REAL XSINX(51),XSINY(51)
      REAL XTWOPI
      DATA XTWOPI/6.28318/
*
*  DEFINE THE WORKSTATION TYPE (Pericom MG600) AND METAFILE
*
      CALL GCINIT (1, MG600, 2, 30, 11)
*
*  DEFINE AND SELECT A TRANSFORMATION THAT DIRECTS OUTPUT
*  TO A WINDOW OF (0.0, 1.0) X (-1.0, 1.0)
*
      CALL GCNAME (2, 'TITLE01')
      CALL GSWN   (1, 0.0, 1.0 ,-1.0, 1.0)
      CALL GSELNT (1)
*
*  BEGIN OUTPUT
*
      DO 10 K=1,51
       XSINX(K) = FLOAT(K-1)*0.02
       XSINY(K) = SIN(XSINX(K)*XTWOPI)
10    CONTINUE
      CALL GPL (51, XSINX, XSINY)
*
*  ALL DONE WITH GKS, CLOSE THE SYSTEM
*
      CALL GPRMPT (1, 'TYPE RETURN', LSTRI, REPLY)
      CALL GCSTOP
      END

Janne Saarela
Mon Apr 3 17:00:12 METDST 1995