Control Object Properties
Psuedo Multi-Properties  
 

Psuedo Multi-Properties are a +PxPlus Exclusive features

Description In many instances an application will need to read or update a number of properties at the same time. For example an application might want to set the 'Item number and 'ItemText$ properties for a list box.

A Psuedo multi-property is basically a property whose name is made up of multiple "String" properties with each property name terminated by a period.

For example:

CtrlObj'prop1.prop2.prop3.$

This 'Psuedo' property would reference the properties 'Prop1$, 'Prop2$, and 'Prop3$ within CtrlObj. If this Psuedo property was read, the values of all the properties would be concatented together and returned as a single string with a field seperator of $00$. When this Psuedo property is updated, the values sent to the property will be broken into multiple values and updated to the associated properties. The last character of the string sent to the Psudeo property will be used as the delimiter.

For example to change an item in a list box (assuming itemno is the item index and valu$ has the new value):

Lbx'item.itemtext.$=str(item)+sep+valu$+sep

Or perhaps to change a grid cell at column 3, row 4:

Grd'colno.row.value.$ = "3,4,Cell Value,"

Since the last character is a comma, the delimiter will be assumed to be a comma. Also note that in order to simplify grid column access the property 'Colno is used rather than 'Column which if used would expect a column name not column number.

To read the current item and index from a list box would be:

READ DATA FROM Lbx'item.itemtext.$,SEP=$00$ TO itemno, valu$

(If desired the PxPlus dynamic field separator parameter could be enabled to have the system auto-detect the field separator -- '+S' System Paramater)



* Note * All system provided property names do an not have dots/periods in them. If accessing a Psuedo multi-property against a user-defined object, the property names reference must not have a dot/period in it.


Why use Pseudo Properties? A major advantage of using Psudeo multi-properties is that when running your application in a client-server configuration with WindX, the number of packets exchanged between the server and the workstation will be reduced.

For example in a grid to read the tip, value, text, and format information about a specific cell you would have to issue:

grd'Colno = col
grd'Row = row
Tip$= grd'CellTip$
Valu$ = grd'Value$
Text$ = grd'Text$
Format$ = grd'CellFormat$

This would require six (6) packet exchanges between the server and the WindX workstation (4 if running Turbo mode). Switching this logic to use Psuedo properties would be:

grd'Colno.Row.$ = str(col)+","+str(row)+","
READ DATA FROM grd'CellTip.Value.Text$,CellFormat.$ TO Tip$,Valu$,Text$,Format$

This would result in only two (2) packets (one if running Turbo mode) between the server and WindX. A 75% (or 80% in Turbo mode) reduction of packets and thus execution time.