home *** CD-ROM | disk | FTP | other *** search
- /*
- @BMovePages @P@ICopyright Gold Disk Inc., January, 1992
-
- This genie will move a range of pages within a document.
- */
- address command
- call SafeEndEdit.rexx()
- call ppm_AutoUpdate(0)
- cr = '0a'x
-
- first = ppm_DocFirstPage()
- last = ppm_DocLastPage()
- cpage = ppm_CurrentPage()
- if cpage = 0 then exit_msg("Please create a page before running this Genie.")
-
- form = "Start Page:"cpage||cr"End Page:"cpage||cr"Destination Page:"last
- form = ppm_GetForm("Enter_Range", 8, form)
- if form = '' then exit_msg()
-
- parse var form startpage '0a'x endpage '0a'x dest
-
- if ~(datatype(startpage, n) & datatype(endpage, n) & datatype(dest,n)) then
- exit_msg("Invalid Entry")
-
- if startpage > endpage then
- do
- temp = endpage
- endpage = startpage
- startpage = temp
- end
-
- if startpage < first | startpage > last | endpage < first | endpage > last | dest > last | dest < first | (dest > startpage & dest < endpage ) then
- exit_msg('Invalid Input')
-
- do i = startpage to endpage
- call ppm_MovePage(startpage, dest)
- end
-
- call exit_msg("Done")
-
- exit_msg: procedure
- do
- parse arg message
-
- if message ~= '' then call ppm_Inform(1, message,)
- call ppm_AutoUpdate(1)
- exit
-
- end
-
-
-