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


Simple polyline program

GDDM V3R2 Base Application Programming Guide
SC33-0867-01



The programming example in Figure 61 uses a stroke device of the default type, namely polyline.

After reading the stroke input, the program redraws the line created by the end user. Most programs that use stroke input for line drawing need to do this, because the echo line disappears from the screen when the next terminal I/O occurs. This example in redraws the line in red.

A second GSREAD sends the redrawn line to the workstation. Before this call is executed, stroke input is disabled, and the ENTER key enabled as a choice device. When the end user presses the ENTER key after the line changes to red, the program ends.



PLSTK: PROCEDURE OPTIONS(MAIN);

DCL (DEVTYPE,DEVID) FIXED BIN(31); DCL DFLAGS(64) FIXED BIN(31); DCL (XARRAY,YARRAY)(64) FLOAT DEC(6); DCL NUM FIXED BIN(31);

CALL FSINIT; CALL GSENAB(5,1,1); /* Enable tablet or mouse for stroke */ CALL GSREAD(1,DEVTYPE,DEVID); /* Read and wait */ CALL GSQSTK(64,DFLAGS,XARRAY,YARRAY,NUM); /* Obtain stroke data.*/

/* Now redraw the polyline from the returned arrays of points */

CALL GSSEG(1); /* Begin new segment. */ CALL GSCOL(2); /* Set color to red. */ CALL GSMOVE(XARRAY(1),YARRAY(1)); /* Make start of line the */ /* current position. */ CALL GSPLNE(NUM,XARRAY,YARRAY); /* Draw the polyline. */ CALL GSSCLS; CALL GSENAB(5,1,0); /* Disable stroke device. */ CALL GSENAB(1,0,1); /* Enable enter key as */ /* choice device. */ CALL GSREAD(1,DEVTYPE,DEVID); /* Display polyline in red. */ CALL FSTERM;

%INCLUDE ADMUPINF; %INCLUDE ADMUPING; END PLSTK;


Figure 61. Program using polylocator stroke device

Go to the previous page Go to the next page



Copyright IBM Corporation 1990, 2012