home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sams Cobol 24 Hours
/
Sams_Cobol_24_Hours.iso
/
Cobol32
/
PowerCBL
/
powercbl.Z
/
array.prc
< prev
next >
Wrap
Text File
|
1997-03-12
|
1KB
|
44 lines
@POWER POWSHEET SHEET1 *
@POWER POWPSBTN PUSH1 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
* Set color.
01 W-COLOR1 PIC X(4).
01 W-COLOR2 PIC X(4).
* Set the index of the label (LABEL1)
01 I PIC S9(4) COMP-5.
LINKAGE SECTION.
01 IDX PIC S9(4) COMP-5.
PROCEDURE DIVISION USING IDX.
* Set the background color in the indexed label areas (LABEL1) by the index
* of the clicked push button (PUSH1).
EVALUATE IDX
WHEN 1
MOVE POW-RED TO W-COLOR1
MOVE POW-DARKRED TO W-COLOR2
WHEN 2
MOVE POW-GREEN TO W-COLOR1
MOVE POW-DARKGREEN TO W-COLOR2
WHEN 3
MOVE POW-BLUE TO W-COLOR1
MOVE POW-DARKBLUE TO W-COLOR2
END-EVALUATE.
* The background color of the three labels is set by the following loop.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 3
* The clicked push button sets its corresponding label to a bright version of
* its specified color and the other push buttons to a dark version of the same color.
IF IDX = I
MOVE W-COLOR1 TO POW-BACKCOLOR OF LABEL1(I)
ELSE
MOVE W-COLOR2 TO POW-BACKCOLOR OF LABEL1(I)
END-IF
END-PERFORM.
@POWER POWPSBTN PUSH4 CLICK
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
* Close the sample application.
CALL CLOSESHEET OF SHEET1.