|
The Edit,
Go To, Page feature is slightly more complex in
WordPeffect 10+ than in earlier versions. For those who want to go to a
specific page number in WP10+ with fewer keystrokes, here's a small
macro (Go to page number.wcm) to do it.
You can assign
it to a keystroke for convenience. The default "Go To" dialog is
<Ctrl+G>, so assigning it to <Alt+G> might be useful.
◄- The downloadable compiled macro is included inside the Zip file in the left column. But for those who want to view the raw (plain text) macro code, see below.
(To copy the code into your WordPerfect program to create a working macro see here. Or just download the compiled version from the left column.)
// Macro code begins here
Application (WordPerfect; "WordPerfect"; Default!)
OnCancel(End@)
// Store the current page number -
vStartPage:=?Page
// Get the desired page number from the user -
Label(GetNumb@)
GETNUMBER (vNewPage;
"Enter the page number to go to: ";
"'Go to Page Number' - (c) 2006 by Barry MacDonnell")
If (vNewPage<=0) // (error check)
Messagebox(;"Error";
"You must enter a number greater than 0 (zero).")
vNewPage:="" // (discard value)
Go(GetNumb@) // (loop back and redisplay dialog)
Endif
// Go to the desired page -
PosPage (Volume:NoneSpecified!; Chapter:NoneSpecified!; Page: vNewPage)
// Get the actual destination page's number (it could be less than the input number) -
vEndPage:=?Page
// Display appropriate message -
Display(On!)
If (vNewPage>vEndPage) // (if input number is larger than destination page number)
If(vEndPage=vStartPage) // (if they are the same, display message and quit)
Messagebox(;"Note -";
"You are already at the end of the document - there is no page "+vNewPage ;
IconExclamation!)
Go(End@)
Endif
Messagebox(vAns;"Note -";
"You are now at the end of the document - there is no page "
+vNewPage+NToC(0F90Ah)+NToC(0F90Ah)+
"Remain at this location? (No=Return to previous page)" ;
YesNo!|IconQuestion!)
If(vAns=2 or vAns=6) Go(End@) Endif // (if Cancel message or Yes, quit now)
If(vAns=7)
PosPage (Volume:NoneSpecified!; Chapter:NoneSpecified!; Page: vStartPage)
Go(End@)
Endif
Endif
If (vEndPage=vStartPage)
Messagebox(;"Note -";
"You are already on page "+vStartPage)
Go(End@)
Endif
Label(End@)
Return
// Macro ends here
|