CREATE RADIOGRP Example


Example:

 

*

 

 

.Define the RADIOGRPs, BUTTON, and other variables

.

 

 

RGROUP1

RADIOGRP

 

RGROUP2

RADIOGRP

 

GROUP1D

INIT

"Keyboard; File;None"

GROUP2D

INIT

"Screen; Printer; File"

BUTTON1

BUTTON

 

RESULT

FORM

2

RGVAL

FORM

1(2)

*

 

 

.Create the Objects

.

 

 

  

CREATE

RGROUP1=2:7:20:40,GROUP1D:

  

  

STYLE=3DOUT,BORDER:

  

  

TITLE="Input Mode"

  

CREATE

RGROUP2=2:7:50:70,GROUP2D:

  

  

STYLE=3DOUT,BORDER:

  

  

TITLE="Output Mode"

  

CREATE

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

*

 

 

.Activate the Objects

.

 

 

  

ACTIVATE

RGROUP1

  

ACTIVATE

RGROUP2

  

ACTIVATE

BUTTON1,EXIT,RESULT

*

 

 

.Set the Default Values

.

 

 

  

SETITEM

RGROUP1,0,1

  

SETITEM

RGROUP2,0,3

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

  EVENTWAIT

 

  

REPEAT

 

*

 

 

.Exit Button Selected - Display the Values of the RADIOGRPs

.

 

 

EXIT

 

 

  

GETITEM

RGROUP1,0,RGVAL(1)

  

GETITEM

RGROUP2,0,RGVAL(2)

.

 

 

  

DISPLAY

*P10:10,"Value of the RADIOGRP ":

  

  

"objects upon exit: ",RGVAL(1):

  

  

",",RGVAL(2),*W3;

  

STOP

 

 

This example creates two (2) RADIOGRPs on the screen. The first group is initialized to item one (1) and the second group is initialized to item three (3). During program execution, the buttons may be clicked or the cursor keys used to change selections. When the Exit BUTTON is clicked, the values of each RADIOGRP are displayed and the program terminates.

 

 



PL/B Language Reference CREATE RADIO Example CREATE SHAPE Example