WPARENT( ) Function

JavaScript Editor js editor     Web development 



Main Page

Returns the name of the parent window of the active or specified window.

WPARENT([WindowName])

Parameters

WindowName


Specifies a window whose parent window name WPARENT(В ) returns. WPARENT(В ) returns the empty string if the specified window doesn't have a parent window. If you omit WindowName, WPARENT(В ) returns the name of the parent window of the active output window. WPARENT(В ) returns the empty string if the active output window doesn't have a parent window.

Return Value

Character

Remarks

You can use DEFINE WINDOW to create a window and place it in a parent window. The child window becomes integrated with its parent window. For example, a child window defined and activated inside a parent window can't be moved outside the parent window. If the parent window is moved, the child window moves with it.

Example

The following example defines a parent and child window. It then uses WPARENT(В ) to identify which window is the parent.

В Copy Code
CLEAR ALL
CLEAR
DEFINE WINDOW wParent ;
   FROM 1,1 TO 20,20 ;
   TITLE 'wParent'     && Parent window
ACTIVATE WINDOW wParent
DEFINE WINDOW wChild ;
   FROM 1,1 TO 10,10 ;
   TITLE 'wChild' ;
   IN WINDOW wParent  && Child window
ACTIVATE WINDOW wChild
WAIT WINDOW 'The parent window is ' + WPARENT( )
RELEASE WINDOW wParent, wChild

See Also



JavaScript Editor js editor     Web development