Partager via


WEXIST( ) Function

Determines whether the specified user-defined window exists.

WEXIST(WindowName)

Return Value

Logical

Parameters

  • WindowName
    Specifies the name of the user-defined window.

    You can also specify the name of a Visual FoxPro system window (the Command window, the Data Session window, a Browse window, and so on), and in Visual FoxPro, the name of a toolbar. WEXIST( ) returns true (.T.) if the system window or toolbar you specify is visible or hidden. WEXIST( ) returns false (.F.) if the specified system window or toolbar is closed.

    Two exceptions are the Command and Debug windows. Including the Command window's name in WEXIST( ) always returns a true value. If the Debug window has been opened, WEXIST( ) returns true, even if the Debug window is closed.

Remarks

WEXIST( ) returns true (.T.) if the user-defined window you specify has been created with DEFINE WINDOW; otherwise WEXIST( ) returns false (.F.). The specified window does not have to be active or visible for WEXIST( ) to return true (.T.), but it must exist.

Example

DEFINE WINDOW wScreen1 FROM 10,10 TO 20,69
DEFINE WINDOW wScreen2 FROM 1,0 TO 19,79
CLEAR

? WEXIST('wScreen1')  && Displays .T.
STORE 'wScreen2' TO gcWinName
? WEXIST('win_name')  && Displays .F.
? WEXIST(gcWinName)  && Displays .T.
RELEASE WINDOWS wScreen1, wScreen2

See Also

Reference

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WONTOP( ) Function

WOUTPUT( ) Function

WVISIBLE( ) Function

Other Resources

Functions

Language Reference (Visual FoxPro)