GETPROP Examples


Example 1:

 

RADIO1

RADIO

 

STATE

FORM

1

  

...

 

  

GETPROP

RADIO,ENABLED=STATE

 

This GETPROP instruction places the current state of the RADIO button in the variable STATE. After the instruction, STATE will contain a one (1) if the button is enabled and a zero (0) if it is disabled.

 

Example 2:

 

RADIO1

RADIO

 

STATE

FORM

1

SETTING

FORM

1

  

...

 

  

GETPROP

RADIO,ENABLED=STATE,VALUE=SETTING

 

This GETPROP instruction places the current state of the RADIO button in the variable STATE and its current value in SETTING.

 

Example 3:

 

  

GETPROP

FLEXGRID,*COLWIDTH(5)=WIDTH

 

This GETPROP instruction places the current width of the fifth column of the FLEXGRID OLE object into the variable WIDTH.

Example 4:

 

A

NETOBJECT

 

B

NETOBJECT

 

C

NETOBJECT

 

DATA

DIM

100

AUTOTRUE

INTEGER

4,"0xFFFFFFFF"

BOOLTRUE

VARIANT

 

BOOLFALSE

VARIANT

 

.

 

 

 

CREATE

BoolTrue,VarType=11,VarValue=AutoTrue

 

CREATE

BoolFalse,VarType=11,VarValue=0

.

 

 

 

CREATE

A,CLASS="System.Windows.Forms.Form":

 

 

Assembly="System.Windows.Forms"

 

CREATE

B,CLASS="System.Windows.Forms.Button":

 

 

Assembly="System.Windows.Forms":

 

 

*Text="Good",*Location="10,10"

 

CREATE

C,CLASS="System.Windows.Forms.Button":

 

 

Assembly="System.Windows.Forms"

.

 

 

 

SETPROP

A,*MaximizeBox=BoolFalse,*MinimizeBox=BoolFalse:

 

 

*HelpButton=BoolTrue

 

SETPROP

A,*Visible=BoolTrue,*Text="Hello .NET World!"

 

SETPROP

C,*Text="Cancel",*Location="10,50"

 

SETPROP

A,*AcceptButton=B,*CancelButton=C

.

 

 

 

A.Controls.Add

Using B ;Add .NET Button to .NET Window

 

A.Controls.Add

Using C ;Add .NET Button to .NET Window

.

 

 

 

GETPROP

A,*Text=DATA

 

DISPLAY

"*Text........:",*LL,DATA,"<<<"

.

 

 

 

GETPROP

A,*Bounds=DATA

 

DISPLAY

"*Bounds......:",*LL,DATA,"<<<"

.

 

 

 

GETPROP

A,*Font=DATA

 

DISPLAY

"*Font........:",*LL,DATA,"<<<"

.

 

 

 

LOOP

 

 

EVENTWAIT

 

 

REPEAT

 

 

This examples shows the SETPROP and GETPROP instructions used with a NETOBJECT.

 



PL/B Language Reference GETMODE Example GOTO Examples