CREATE EDITDATETIME Example


Example:

 

*

 

 

.Define the Objects and Variables

.

 

 

EDITDT1

EDITDATETIME

 

BUTTON1

BUTTON

 

RESULT

INTEGER

1

STEXT

STATTEXT

(3)

VALUE

DIM

40

*

 

 

.Create the Objects

.

 

 

  

CREATE

STEXT(1)=8:9:20:37,"Select a Date:":

  

  

"SYSTEM(8,BOLD)"

  

CREATE

EDITDT1=8:9:32:48

  

  

 

  

CREATE

STEXT(2)=12:13:102:30,"Value of EditDateTime:":

  

  

"SYSTEM(8,BOLD)"

  

CREATE

STEXT(3)=12:13:32:48,"":

  

  

"SYSTEM(8,BOLD)"

  

 

 

  

CREATE

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

*

 

 

.Activate the Objects

.

 

 

  

ACTIVATE

STEXT

  

ACTIVATE

EDITDT1

  

EVENTREGISTER

EDITDT1,3,UPDATE

  

ACTIVATE

BUTTON1,QUIT,RESULT

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

EVENTWAIT

 

  

REPEAT

 

*

 

 

.Show the value of the object

.

 

 

UPDATE

 

 

  

GETITEM

EDITDT1,0,VALUE

  

SETITEM

STEXT(3),0,VALUE

  

RETURN

 

*

 

 

.Terminate the Program

.

 

 

QUIT

 

 

  

STOP

 

 

 

This example creates an EDITDATETIME object an allows the user to interact with it. When a new date is selected, the value within the obejct is displayed. If the Exit BUTTON is clicked, the program terminates.

 

 



PL/B Language Reference CREATE DIALOG Example CREATE EDITNUMBER Example