guides:programming:programmers_reference_manual:set_property_only

Set_Property_Only Subroutine

Updates the value of a specified property for an object without returning the original value.

Call Set_Property( Object, Property, NewValue, Index )

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.

N/A – Set_Property_Only is a subroutine, not a function.

N/A

One of the problems with the normal Set_Property function is that it also performs an implicit Get_Property operation to return the previous contents of the property to the caller. In many cases this information is simply discarded after the “Set” making the “Get” call actually unnecessary, and this inefficiency usually goes unnoticed as the quantity of information retrieved during the “Get” is often small. However, in some cases the effect is noticeable: For example, setting the ARRAY property of an EditTable that contains several thousand rows to null (i.e. clearing it), will produce a noticeable delay while the ARRAY contents are accessed and returned. Using Set_Property_Only alleviates this issue, resulting in better performance.

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

If an invalid object or property name is specified then no update occurs. No error condition is flagged.

 
* // Set the text of the current window

   Call Set_Property_Only( @Window, "TEXT", NewText )

   

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

   * // current window

   Call Set_Property_Only( @Window : ".RBN_GENDER", "VALUE", "M" )

   

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

   Call Set_Property_Only( @Window : ".TAB_MAIN.TABS", "TEXT", "Events", 3 )

   

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

   Call Set_Property_Only( @Window : ".TAB_MAIN.TABS", "VALUE", "E", "Events" )
  • guides/programming/programmers_reference_manual/set_property_only.txt
  • Last modified: 2023/10/25 10:50
  • by 127.0.0.1