Set_Property_Only Subroutine
Description
Updates the value of a specified property for an object without returning the original value.
Syntax
Call Set_Property( Object, Property, NewValue, Index )
Parameters
Name | Required | Description |
---|---|---|
Object | Yes | Identifier of the object to access. Must be in upper-case. |
Property | Yes | Name of the property to access. Must be in upper-case. |
NewValue | Yes | New value for the property. Can be null. |
Index | No | If 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
N/A – Set_Property_Only is a subroutine, not a function.
Errors
N/A
Remarks
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.
Example
* // 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" )