OBJECT Example


Example:

 

A

BUTTON

 

B

STATTEXT

 

GEN

OBJECT

;This is a POINTER!

GEN1

OBJECT

^

*

 

 

.Create the Objects

.

 

 

  

CREATE

A=2:3:5:15,"TEST"

  

CREATE

B=5:6:5:20,"STATTEXT DATA",""

*

 

 

.Use the Objects

.

 

 

  

MOVEADR

A,GEN

  

SETPROP

A,VISIBLE=1

  

CALL

SHOWOBJ USING B

*

 

 

.Wait for an Event to Occur

.

 

 

  

LOOP

 

  

EVENTWAIT

 

 

REPEAT

 

*

 

 

.Clicked Inside Mouse Region

.

 

 

SHOWOBJ

ROUTINE

GEN1

.

 

 

  

CHECKPROP

GEN1,"VISIBLE"

  

IF

EQUAL

  

SETPROP

GEN1,"VISIBLE"

  

ENDIF

 

  

RETURN

 

 

This sample program creates a BUTTON and a STATTEXT object. It then illustates the use of the generic OBJECT pointer to access properties indirectly.

 



PL/B Language Reference