home *** CD-ROM | disk | FTP | other *** search
- /*
- @BCopyPageSpecs @P@ICopyright Gold Disk Inc., February, 1992
- Copy page specification from the current page to a range of pages.
- */
-
- address command
- call SafeEndEdit.rexx()
- cr = '0a'x
- pageopts = "OODDEEVENAALL"
- first = ppm_DocFirstPage()
- last = ppm_DocLastPage()
- form = "Start Page:"first'0a'x "End Page:"last'0a'x "ODD/EVEN/ALL:"ALL
- form = upper(ppm_GetForm("Enter Info", 7, form))
- if form = '' then call exit_msg()
- parse var form startpage '0a'x endpage '0a'x pageopt
-
- if ~(datatype(startpage, n) & datatype(endpage, n)) | pos(pageopt, pageopts) = 0
- then exit_msg("Invalid input")
-
- if startpage < first | startpage > last | endpage < first | endpage > last then
- exit_msg('Invalid input')
-
- if startpage > endpage then
- do
- temp = startpage
- startpage = endpage
- endpage = temp
- end
-
- increment = 1
-
- if pageopt = 'O' | pageopt = 'ODD' then
- do
- if ~(startpage // 2) then startpage = startpage + 1
- increment = 2
- end
- else if pageopt = 'E' | pageopt = 'EVEN' then
- do
- if (startpage // 2) then startpage = startpage + 1
- increment = 2
- end
-
- call ppm_ShowStatus("Working...")
-
- page = ppm_CurrentPage()
- pagetype = ppm_GetPageType(page)
- pagesize = separate(ppm_GetPageSize(page))
- pagemargins = separate(ppm_GetPageMargins(page))
- pagecolumns = separate(ppm_GetPageColumns(page))
-
- call ppm_AutoUpdate(0)
-
- ps = "call ppm_SetPageSize(page,"pagesize")"
- pm = "call ppm_SetPageMargins(page,"pagemargins")"
- pc = "call ppm_SetPageColumns(page,"pagecolumns")"
-
- do page = startpage to endpage by increment
-
- call ppm_ShowStatus("Working on page "page"..")
- call ppm_GotoPage(page)
-
- call ppm_SetPageType(page, pagetype)
- interpret ps
- interpret pm
- interpret pc
-
- end
-
- call exit_msg("Done")
-
- exit_msg:
- do
- parse arg message
- call ppm_Inform(1, message,)
- call ppm_ClearStatus()
- call ppm_AutoUpdate(1)
- exit
- end
-
- separate:
- do
- parse arg settings
-
- inpar = ''
-
- do i = 1 to (words(settings) - 1)
-
- set = word(settings, 1)
-
- inpar = inpar||set","
- settings = subword(settings,2)
-
- end
-
- inpar = inpar||settings
-
- return(inpar)
-
- end
-
-