POS property

Database associated controls.

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.

Retrieve the position of the specified column:

columnposition = Get_Property(objectname, "POS")

Value returned by Get_Property:

ValueDescription
columnposition0 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.

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
  • guides/programming/programmers_reference_manual/pos.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1