Table of Contents

Set_Property function

Description

Updates the value of a specified property for an object and returns the current value.

Syntax

OrigValue = Set_Property( Object, Property, NewValue, Index )

Parameters

NameRequiredDescription
ObjectYesIdentifier of the object to access. Must be in upper-case.
PropertyYesName of the property to access. Must be in upper-case.
NewValueYesNew value for the property. Can be null.
IndexNoIf the property supports indexing then this parameter specifies the index value(s). Indexed properties can have one or two dimensions – if the latter then the dimensions are @fm-delimited.

<1> First dimension
<2> Second dimension

The actual index value themselves are specific to the property in question. In most cases they will be numeric, but some properties can handle quoted text values as well.

Returns

Returns the current property value. If an invalid object or property name is specified then no update occurs and an empty string (null) is returned. No error condition is flagged.

Errors

N/A

Remarks

Set_Property supports the property concatenation interface described in Appendix A – Concatenating Properties.

Example

 
* // Set the text of the current window

   OrigText = Set_Property( @Window, "TEXT", NewText )

   

   * // Set the current value of the RBN_GENDER radiobutton group on the

   * // current window

   OrigGender = Set_Property( @Window : ".RBN_GENDER", "VALUE", "M" )

   

   * // Set the text of the third tab for TAB_MAIN using a numeric index

   OrigText = Set_Property( @Window : ".TAB_MAIN.TABS", "TEXT", "Events", 3 )

   

   * // Set the value of the "Events" tab for TAB_MAIN using a literal index

   OrigText = Set_Property( @Window : ".TAB_MAIN.TABS", "VALUE", "E", "Events" )