Applies to
Database associated controls.
Description
Returns the position of the column, relative to the data table structure, associated with the specified control. If 0, then the column is a key or a key part. Use with Get_Property(), only.
Usage
Retrieve the position of the specified column:
columnposition = Get_Property (objectname, "POS")
Returns
Value returned by Get_Property:
| Value | Description |
|---|---|
| columnposition | 0 if a key or key part, or the position of the column in the row. |
This value is often of use in accessing data. For example, if you want to replace existing data in a column referenced by a control with a user-supplied string to each data item, you could use the POS property to find the position of the associated column in the data table, then write the new data to the data table.
See Also
PART property, ID property, MV property, TYPE property
Example
function KeyControls(Window)
* returns an @fm-delimited list of key controls
declare function Get_Property
* get list of all controls
CtrlList = Get_Property(Window, "CTRLMAP")
convert @fm to @rm in CtrlList
* get field positions of all controls
PosList = Get_Property(CtrlList, str("POS": @rm, | count(CtrlList, @rm)): "POS")
* build list of keys
KeyList = ""
loop
locate "0" in PosList using @rm setting Pos else Pos = 0
while Pos
KeyList<-1> = field(CtrlList, @rm, Pos)
PosList = field(PosList, @rm, Pos+1, 999) ; * create new PosList
CtrlList = field(CtrlList, @rm, Pos+1, 999) ; * create new CtrlList
repeat
return KeyList