Top$

Windows management function.

The Top$ function returns the name of the main window which has the focus.

Syntax

window_name$=Top$()

Return value

window_name$, string. If the main window contains several child windows, Top$ returns the window name of the main window containing the active child window (wheras the Focus$() function gives the window name of the child window which has the focus).

Example code

This script shows the difference between Top$ and Focus$.

 

Rem Run Sysedit

 

shell("sysedit")

pause 3 secs

 

 

Window_Name$=Focus$()

Text$="Function Focus$ returns : " + Window_Name$

Msgbox(Text$)

 

Pause 3 secs

Window_Name$=Top$()

Text$="Function Top$ returns : " + Window_Name$ + " (main window)"

Msgbox(Text$)