SETPROP


8.0.5, PLBCMP GUI Only

square.png Objects

 

The SETPROP instruction changes specific properties of object variables. The instruction uses the following format:

 

(1)

[label]

SETPROP

{object},{property}:

 

 

 

[({index})][={value}][,{property}[={value}...]]

(2)

[label]

SETPROP

{object1},*{property}:

 

 

 

[({index})][={value}][,*{property}[={value}...]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A previously defined and created OBJECT, a pointer to an object, the *ARG1 through *ARG10 internal objects, the *RESULT internal object, or a COLLECTION of objects whose property is set.

object1
Required. A previously created NETOBJECT, NETCONTROL, CONTROL, CONTAINER, AUTOMATION object, a pointer to any of these objects, or a COLLECTION that contains any of these objects.

property

Required. A valid property string for a given object.

index

Optional. An Index for property arrays.

value

Optional. A value assigned to the property for the specified object.

Flags Affected: none

Note the following:

  1. The {object} must have been previously defined and created. When using the format (1), the {object} can be any GUI object except for a NETOBJECT, NETCONTROL, CONTROL, CONTAINER, or AUTOMATION object. When using the format (2), the {object1} should be a NETOBJECT, NETCONTROL, CONTROL, CONTAINER, AUTOMATION, or a COLLECTON that contains these objects.

  2. The internal VARIANT objects named *ARG1 through *ARG10 may be specified for the {object} parameter. These objects represent the ARGn objects for an EVENTREGISTER statement.

  3. The *RESULT internal VARIANT object represents the result returned from a connected 'Plbwin.ProgramNE' object. The *RESULT variant must be used to return results when using the JScript language in HTML pages to execute the EVENTSEND method for a PL/B program object.

  4. A SETPROP of the VARVALUE or VARABSVALUE property value for a VARIANT that was created using the $VT_ARRAY type will change the first variant value in the VARIANT array.

  5. At least one property string is required.

  6. Valid properties for each object are listed in the section on object definition.

  7. No action occurs if the specified property is not valid for a particular object in a COLLECTION.

  8. The {object} must be CREATEd before using SETPROP. If this is not done, a runtime error of O105 is generated. However, if the {object} is a COLLECTION that has not been created, the SETPROP operation is ignored and no error occurs."

  9. If insufficient memory is available to perform the operation, a runtime error of O106 is generated.

  10. The optional {index} may be specified for property arrays.

  11. Any properties available for a NETOBJECT are found in the class library description as specified by the CLASS identification string. All properties must be specified using the '*' syntax format (2) or a format as described under the NETOBJECT description notes.

  12. SETPROP supports enhanced array processing. When the target {object} for the SETPROP is an array that does not specify an explicit element, the compiler generates the necessary logic to cause the execution of the SETPROP to be repeated for all of the objects in the array.

  13. When the object is a PLBOBJECT, the properties are retrieved from afunction found in CLASSMODULE load module specified by the PLBOBJECT object declaration. In this case, a PLBOBJECT property name is accessing a FUNCTION in the CLASSMODULE that has a PL/B label formatted as 'Set_PropName'. The PLBOBJECT properties use the '*prop=value' syntax format.

  14. Example:

          GETPROP PLBOBJECT,*Prop1=value: //'Get_Prop1' in CLASSMODULE

                            *Prop2=value //'Get_Prop2' in CLASSMODULE.

 

 

See Also: Example Code, GETPROP, Object Definitions, Properties, Object Instructions

 



PL/B Language Reference SETITEM