User Tools

Site Tools


prop_child.htm
Navigation:  Language Reference > App C - PROP: Runtime Properties > Complete Property List >====== PROP:Child and PROP:ChildIndex ====== Previous pageReturn to chapter overviewNext page

PROP:Child is an array property which returns the control number (e.g., Field Equate number) of a child control in a parent control structure (such as a SHEET, TAB, OPTION, or GROUP). (READ ONLY) The element number (array index into the property) is the ordinal position of the control in the parent structure. Returns null string () if the element number is out of range. ?Sheet{Prop:Child,Choice(?Sheet)} is equivalent to using ?Sheet{Prop:ChoiceFEQ}. PROP:ChildIndex is an integer property which returns the ordinal position of all the child controls in a parent control structure (such as a SHEET, TAB, OPTION, or GROUP). (READ ONLY) The element number is the control number of the control in the parent structure. Returns a null string () if the element number is out of range.

PROP:ChildIndex is normally used with the child control Field Equate Label. Use the PROP:Parent property to determine the parent control's Field Equate Label.

Example:

Chld    PROCEDURE
optvar1 string(32)
Label   STRING('Test')
WinView     WINDOW('Child One'),SYSTEM,MAX,AT(0,0,141,106),MDI,FONT('Microsoft Sans Serif', 10,,, CHARSET:DEFAULT),HVSCROLL
STRING('String1'), AT(2,2), USE(Label)
OPTION('Option 1'), AT(0,17,103,41), USE(OptVar1), KEY(F10Key), HLP('Option1Help')
RADIO('Radio 1'), AT(0,17,42,20), USE(?R1)
RADIO('Radio 2'), AT(2,37,40,20), USE(?R2)
END
END
CODE
OPEN(WinView)
LOOP X# = 1 TO 99
Y# = ?OptVar1{PROP:Child,X#}
IF NOT Y#
BREAK
END
EXECUTE X#
Z# = ?R1{PROP:ChildIndex}
Z# = ?R2{PROP:ChildIndex}
END
MESSAGE('Radio ' & Z# & ' is field number ' & Y#)
END
ACCEPT
END
!Example of usage with a sample SHEET control
SHEET,AT(5,177,133,123),USE(?Sheet1)
TAB('Tab Alpha'),USE(?TabAlpha)
END
TAB('Tab Bravo'),USE(?TabBravo)
END
TAB('Tab Charlie'),USE(?TabCharlie)
END
END
?Sheet1{PROP:Child,Nth}
!returns the Field Equate of the Nth tab in the sheet.
TabFeq = ?Sheet1{PROP:Child,2}
!is equivalent to
TabFeq=?TabBravo
SELECT(?TabBravo)
!is equivalent to
SELECT(?Sheet1{PROP:Child,2})
?Sheet1{PROP:Child,CHOICE(?Sheet1)}
!is equivalent to
?Sheet1{PROP:ChoiceFEQ}
!get FEQ of the last tab:
LastFEQ = ?Sheet1{PROP:Child,(?Sheet1{Prop:NumTabs})}
!get FEQ of the first tab
?Sheet1{Prop:Child, 1 }
!Does the next tab on the sheet exist and not hidden?
IF CHOICE(?Sheet1) <; ?Sheet1{Prop:NumTabs} AND
(?Sheet1{PROP:Child,CHOICE(?Sheet1)+1}){PROP:Hide} <;> TRUE

See Also: PROP_Parent

prop_child.htm.txt · Last modified: 2021/04/15 15:57 (external edit)