GDDM V3R2 Base Application Programming Guide
Previous topic | Next topic | Contents | Index | Contact z/OS | Library | PDF | BOOK


A BASIC programming example

GDDM V3R2 Base Application Programming Guide
SC33-0867-01




     ________________________________________________________________________
     0010 REM  How to use GDDM from an IBM BASIC program
     0020 REM  === == === ==== ==== == === ===== =======
     0030 REM
     0040 REM  This sample program gives
     0050 REM  some suggestions on how to use this function.
     0060 REM
     0070 REM  Two general things to remember - you need to be linked to
     0080 REM  GDDM and have the appropriate GLOBAL command in effect to run.
     0090 REM  An example is:
     0100 REM     GLOBAL TXTLIB ADMRLIB ADMHLIB ADMPLIB ADMGLIB
     0110 REM  If your default CMS LDRTBLS is less than 5,
     0120 REM  you probably need to SET LDRTBLS 5 or more.
     0130 REM
     0140 REM  BASIC GDDM coding employs numbers for calls. To make it more
     0150 REM  obvious which call is doing what, these numbers have been
     0160 REM  equated with the familiar call names.
     0170 REM
     0180 OPTION BASE 1
     0190 INTEGER
     COLORS,HEAD_ATT,LABEL_ATT,KEY_ATT,ATMOD,PAT_ATT,AX_ATT,COPYP
     0200 DIM
     YARRAY(8),COLORS(4),HEAD_ATT(4),LABEL_ATT(4),KEY_ATT(4),PAT_ATT(3)
     0210 DIM AX_ATT(3),COPYP(3)
     0220 DATA 24,41,18,17,31,29,13,27
     0230 MAT READ YARRAY
     0240 DATA 1,2,4,6
     0250 MAT READ COLORS
     0260 DATA 7,3,0,175
     0270 MAT READ KEY_ATT
     0280 DATA 6,3,0,200
     0290 MAT READ HEAD_ATT
     0300 DATA 2,3,0,300
     0310 MAT READ LABEL_ATT
     0320 DATA 16,16,16
     0330 MAT READ PAT_ATT
     0340 DATA 7,0,0
     0350 MAT READ AX_ATT
     0360 DATA 0,1,1
     0370 MAT READ COPYP
     0380 CHRNIT = 268501248    :  CHXLAB = 268567811  :  CHHEAD = 268567042
     0390 CHKEY  = 268567041    :  CHPIE  = 269289990  :  CHTERM = 268435712
     0400 ASREAD = 202375168    :  CHSET  = 268566785  :  CHCOL  = 268567299
     0410 GSCLR  = 202113795    :  CHHATT = 268568833  :  CHLATT = 268568835
     0420 CHKATT = 268568837    :  CHKEYP = 268568577  :  CHPAT  = 268567300
     0430 ASCPUT = 201852419    :  ASDFLD = 201852672  :  CHAATT = 268568321
     0440 FSOPEN = 202899456    :  GSCOPY = 202899458  :  FSCLS  = 202899460
     0450 CALL GDDM (CHRNIT)
     0460 CALL GDDM (GSCLR)
     0470 CALL GDDM (CHCOL,4,COLORS())
     0480 CALL GDDM (CHPAT,3,PAT_ATT())
     0490 CALL GDDM (CHXLAB,2,4,'19721984')
     0500 CALL GDDM (CHSET,'CBOX')
     0510 CALL GDDM (CHSET,'ABPI')
     0520 CALL GDDM (CHSET,'KBOX')
     0530 CALL GDDM (CHKEYP,"H","T","C")
     0540 CALL GDDM (CHKATT,4,KEY_ATT())
     0550 CALL GDDM (CHLATT,4,LABEL_ATT())
     0560 CALL GDDM (CHAATT,3,AX_ATT())
     0570 CALL GDDM (CHKEY,4,12,"PROGRAMMERS    PROFESSORS MAIL CARRIER DP OPERATOR")
     0580 CALL GDDM (CHPIE,2,4,YARRAY())
     0597 CALL GDDM (ASREAD,ATTYPE,ATMOD,COUNT)
     0600 CALL GDDM (FSOPEN,'PIE     ',3,COPYP())
     0613 CALL GDDM (GSCOPY,60,120)
     0626 CALL GDDM (FSCLS,1)
     0630 CALL GDDM (GSCLR)
     0640 CALL GDDM (CHTERM)
     0650 END

0660 REM 0670 REM Here is a little guidance as to how data is passed in an array. 0680 REM The basic calls are positional, and they expect a specific 0690 REM number of parameters. If you have an array 0700 REM defined with data in it to pass to GDDM you can't just name 0710 REM the array. In other words, if you have: 0720 REM 100 DIM NUMBERS(8) 0730 REM to define an array with 10 elements 0740 REM when you pass this array to GDDM within a call it goes inside 0750 REM the parenthesis as: 0760 REM NUMBERS() 0770 REM not as: 0780 REM NUMBERS or NUMBERS(8) or NUMBERS(X) 0790 REM


     ________________________________________________________________________

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012