Partager via


WTITLE( ) Function

Returns the title assigned to the active or specified window.

WTITLE([WindowName])

Return Value

Character

Parameters

  • WindowName
    Specifies a window whose title WTITLE( ) returns. The title assigned to the window with the TITLE clause is returned if you include the name of a user-defined window created with DEFINE WINDOW.

    When you issue BROWSE WINDOW to open a Browse window in a user-defined window, WTITLE( ) returns the title of the user-defined window if the Browse window doesn't have a title. WTITLE( ) returns the title of the Browse window if the Browse window does have a title.

    You can also use the empty string for WindowName to specify the main Visual FoxPro window.

Remarks

WTITLE( ) can be used to return a window's title, which appears in the top border of the window. The title is returned for the active window if you omit WindowName. WTITLE( ) returns the empty string if the Debug, Trace or Command window is active or output is being directed to the main Visual FoxPro window.

Window Names and Titles   Names are assigned to user-defined windows, system windows, toolbars (in Visual FoxPro), and Browse windows in the following manner:

User-defined windows are assigned names when they are created with DEFINE WINDOW. There is a distinction between user-defined window names and titles. By default, user-defined windows don't have titles. If the TITLE clause is included when the window is created, the specified title appears in the top border of the window, but isn't the name of the window.

By default, each system window, which is part of the Visual FoxPro interface, derives its name from the title of the window. Examples of system windows include the Command window, the Data Session window, and the Trace window. In Visual FoxPro, each toolbar derives its name from the title of the toolbar.

Program and editing windows and the Label and Report Designer windows derive their names from the name of the file being created or modified.

A Browse window derives its name from the title of the window. The name and title of the Browse window is assigned in one of three ways: either by the default title assignment of the table alias, or by the window title (if any exists), or by the Browse title (if any exists).

By default, the Browse window name is the table alias.

To specify a system window and toolbar names in commands and functions, enclose the entire system window or toolbar name in quotation marks. For example, to hide the Report Controls toolbar in Visual FoxPro, issue the following command:

HIDE WINDOW "Report Controls"

Additional Notes on Window Names   If you are unsure of the name assigned to a window, check the Window menu. All window names are listed at the bottom of the Window menu.

Two windows exist if you issue BROWSE WINDOW WindowName. The Browse window is a separate window and takes on the attributes of the specified user-defined window. If a window is active when you issue BROWSE and you don't include the WINDOW clause, the Browse window takes on the attributes of the active window. You can override this behavior by including NORMAL in BROWSE.

You can include window names that contain spaces in commands and functions that accept window names, such as MOVE WINDOW, DEACTIVATE WINDOW, and WONTOP( ), by specifying the part of the window name that begins with the first non-space character and continuing until the last non-space character is encountered.

For example, a Browse window with the name Invoice Entry can be moved with this command:

MOVE WINDOW invoice BY 1,1

The names of user-defined windows cannot contain spaces, but the names of Browse and system windows can.

See Also

Reference

ACTIVATE WINDOW Command

DEFINE WINDOW Command

WEXIST( ) Function

WLAST( ) Function

WONTOP( ) Function

WOUTPUT( ) Function

WREAD( ) Function

Other Resources

Functions

Language Reference (Visual FoxPro)