@IN'est pas du Domaine Publique. Tous Droits Réservés.
Traduit par Fabien Larini le 24/07/93.
Ce Génie remplace toute les boîtes à une position donnée sur un ensemble
de pages. Il vous demande de sélectionner la boîte qui détermine
la position des boîtes à échanger et qui sera copiée à la place de celles
qui auront le même emplacement au niveau du coin supérieur gauche.
Le contenu des boîtes qui sont remplacées est perdu.
*/
/*
ReplaceBoxesOnPages
This Genie will replace each box at a particular position on a range of pages. You will be prompted to select the box which occurs at a position on the range of pages.
The box you click on will replace all boxes in the page range which are in exactly the same position, as defined by the top left corner.
Written by Don Cox May '92
*/
cr = '0a'x
pageopts = "GCHESDRTESTOUTES"
address command
call SafeEndEdit.rexx()
call ppm_AutoUpdate(0)
counter = 0
signal on error
signal on syntax
boxpos = ppm_GetClickPosition("Clickez dans la Boîte à Copier sur chaque Pages")
originalpage = ppm_CurrentPage()
boxtop = word(boxpos, 2)
boxleft = word(boxpos, 1)
box = ppm_BoxAtPosn(boxleft, boxtop)
if box = 0 then exit_msg()
if upper(word(ppm_GetBoxInfo(box), 1)) = "TEXTE" & ppm_TextOverFlow(box) then
text = ppm_GetArticleText(box,1)
else
text = ''
docstart = ppm_DocFirstPage()
docend = ppm_DocLastPage()
pages = upper(ppm_GetForm("Sur quelles Pages ?", 20, "De la Page :"docstart'0a'x "A la Page :"docend'0a'x "GCHES/DRTES/TOUTES"))
if pages = '' then exit_msg()
parse var pages startpage '0a'x endpage '0a'x pageopt
if (startpage ~= '' & datatype(startpage) ~= NUM) | (endpage ~= '' & datatype(endpage) ~= NUM ) then exit_msg("Données Invalides")
increment = 1
/*
* Check error conditions
*/
if startpage < docstart then exit_msg('Intervale Incorrect')
else if startpage > docend then exit_msg('Intervale Incorrect')
if endpage < docstart then exit_msg('Intervale Incorrect')
else if endpage > docend then exit_msg('Intervale Incorrect')
if endpage < startpage then exit_msg('Intervale Incorrect')
if (pageopt = 'TOUTES' | pageopt = 'T' | pageopts = "") then
do
increment = 1
end
else if pageopt = 'GCHES' | pageopt = 'G' then
do
increment = 2
if (startpage // 2) then startpage = startpage + 1
end
else if pageopt = 'DRTES' | pageopt = 'D' then
do
increment = 2
if ~(startpage // 2) then startpage = startpage + 1
end
if startpage > endpage then
do
temp = startpage
startpage = endpage
endpage = temp
end
do page = startpage to endpage by increment
if page ~= originalpage then do
call ppm_ShowStatus("Travail en cours sur la Page "page)