GetNextSheet

Description

Obtains the sheet that is behind the specified sheet in the MDI frame.

Applies to

MDI frame windows

Syntax

mdiframewindow.GetNextSheet ( sheet )

Argument

Description

mdiframewindow

The MDI frame window in which you want the next sheet

sheet

The sheet for which you want the sheet that is behind it

Returns

Window. Returns the sheet that is behind sheet in the MDI frame. If there is no sheet behind sheet, GetNextSheet returns an invalid value. If any argument’s value is null, GetNextSheet returns null.

Usage

To cycle through the open sheets in a frame, use GetFirstSheet to get the front sheet and GetNextSheet one or more times to get the rest of the sheets. Test each return value with IsValid to see if you have reached the last sheet. Do not use GetFirstSheet and GetNextSheet in combination with GetActiveSheet.

NoteDid GetNextSheet return a valid window? Use the IsValid function to find out if GetNextSheet returned a valid window. If there is no sheet behind the one you specified, the return value is not valid.

Examples

Example 1

The following script for a menu selection loops through the open sheets in front-to-back order and displays the names of the open sheets in the ListBox lb_sheets:

boolean bValid

window wSheet


lb_sheets.Reset()

wSheet = ParentWindow.GetFirstSheet()

IF IsValid(wSheet) THEN

   lb_sheets.AddItem(wSheet.Title)

   DO

   wSheet = ParentWindow.GetNextSheet(wSheet)

   bValid = IsValid (wSheet)

   IF bValid THEN lb_sheets.AddItem(wSheet.Title)

   LOOP WHILE bValid

END IF

See also