CREATE CHECKGRP Example


Example:

 

*

 

 

.Define the CHECKGRP, BUTTON, and other variables

.

 

 

CHKGRP1

CHECKGRP

 

GROUP1D

INIT

"Display to Screen;":

  

  

Print to Printer;Spool to File"

BUTTON1

BUTTON

 

RESULT

FORM

2

CGVAL

FORM

1(3)

*

 

 

.Create the Objects

.

 

 

  

CREATE

CHKGRP1=5:10:30:50,GROUP1D,STYLE=3DOUT,BORDER

  

CREATE

BUTTON1=16:17:35:42,"Exit"

*

 

 

.Activate the Objects

.

 

 

  

ACTIVATE

CHKGRP1

  

ACTIVATE

BUTTON1,EXIT,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.Exit Button Selected - Display the Value of the CHECKGRP items

.

 

 

EXIT

 

 

  

GETITEM

CHKGRP1,1,CGVAL(1)

  

GETITEM

CHKGRP1,2,CGVAL(2)

  

GETITEM

CHKGRP1,3,CGVAL(3)

.

 

 

  

DISPLAY

*P10:22,"Value of the CHECKGRP ":

  

  

  "items upon exit: ",CGVAL(1),", ",CGVAL(2):

  

  

  ", ",CGVAL(3),*W3;

  

STOP

 

 

This example creates a CHECKGRP on the screen. During program execution, the boxes may be clicked to set or clear the checks. When the Exit BUTTON is clicked, the value of each item of the CHECKGRP is displayed and the program terminates.

 

 



PL/B Language Reference CREATE CHECKBOX Example CREATE COLOR Examples