GetNextSheet PowerScript function
Description
Obtains the sheet that is behind the specified sheet in the
MDI frame.
Controls
MDI frame windows
Syntax
|
1 |
<span>mdiframewindow</span>.<span>GetNextSheet</span> ( <span>sheet</span> ) |
|
Argument |
Description |
|---|---|
|
mdiframewindow |
The MDI frame window in which you want |
|
sheet |
The sheet for which you want the sheet |
Return Values
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.
Did 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
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:
|
1 |
boolean bValid |
|
1 |
window wSheet |
|
1 |
|
1 |
lb_sheets.Reset() |
|
1 |
wSheet = ParentWindow.GetFirstSheet() |
|
1 |
IF IsValid(wSheet) THEN |
|
1 |
   lb_sheets.AddItem(wSheet.Title) |
|
1 |
   DO |
|
1 |
   wSheet = ParentWindow.<span>GetNextSheet</span>(wSheet) |
|
1 |
   bValid = IsValid (wSheet) |
|
1 |
   IF bValid THEN lb_sheets.AddItem(wSheet.Title) |
|
1 |
   LOOP WHILE bValid |
|
1 |
END IF |