listwindownumbers(
DATABASE
)

The listwindownumbers( function builds a text array containing a list of window ID numbers for all the open windows associated with a particular file.


Parameters

This function has one parameter:

database – is the name of the database file that you want to list the windows of. This should be the name of an open database. If the file parameter is empty (“”) the listwindownumbers( function will list all open windows, no matter what database they are in. You can also omit the parameter entirely, which will also list all open windows.


Description

This function builds a text array containing a list of window ID numbers for all the open windows associated with a particular file.

The example below uses the listwindowsnumbers( function to check to see if the Invoice:Status window is open. If it is, it brings the window to the front. If not, the procedure opens the form (which of course also brings it to the front).

looparray listwindows("Invoice"),cr(),wNumText
    let windowNumber = val(wNumText)
    if windowinfo(windowNumber,"form")="Status"
        window windowNumber
        return
    endif
endloop
openfarform "Invoice","Status"

Since this code uses window ID numbers instead of window names, it will work even if the window name has been changed with the windowname statement. See listwindows( to see an alternate example that uses window names.


See Also


History

VersionStatusNotes
10.2NewNew in this version.