JavaScript Editor js editor     Web development 

Main Page

Determines whether the active or specified window is in front of all other windows.




Specifies the name of the window WONTOP(В ) evaluates. You can specify the name of a user-defined window created with DEFINE WINDOW or a system window (the Command window, the Data Session window, a Browse window, and so on). If you omit WindowName, WONTOP(В ) returns the name of the "frontmost" or active window. You can also include the empty string in WindowName to specify the main Visual FoxPro window. If the Debug, Trace, or Command window is active and you don't specify a window name, WONTOP(В ) returns the name of the window most recently in front. When you are debugging a program that uses WONTOP(В ), program execution isn't affected by bringing these windows forward.

Return Value

Character or Logical


WONTOP(В ) returns true (.T.) if the specified window is active. It returns false (.F.) if the window isn't active or doesn't exist.

Historically in prior versions of Visual FoxPro, the Data Session window has always been referred to as the View window. Additionally, language used to control this window, such as HIDE WINDOW, ACTIVATE WINDOW, WONTOP(В ), also refers to this window as the View window. Visual FoxPro continues to refer to the View window for the WONTOP(В ) function.


The following example uses WONTOP(В ) to display the name of the active window. Before you run this program, open some windows (Browse windows, the Data Session window, and so on), then run the example.

В Copy Code
   WAIT WINDOW 'Frontmost window: ' + WONTOP( )
   WAIT WINDOW 'No windows are open'

See Also

JavaScript Editor js editor     Web development