/* @BImprimeAvecOffsets @P @I Ecrit et © par Don Cox juin 1993 @IN'est pas du Domaine Publique. Tous Droits Réservés. Traduit par Fabien Larini le 1/08/93. Ce Génie permet d'imprimer sur une imprimante matricielle avec des origines différentes pour les pages paires et impaires. Le reste des données (densité, ...) sont celles courantes lors du lancement du Génie. */ /* PrintWithOffsets*/ /* This genie allows you to print to a "Dot-Matrix" (i.e. non-PostScript) printer with different offsets for alternate pages. Written by Don Cox June 93. Not Public Domain. */ cr = '0a'x address command call SafeEndEdit.rexx() units = ppm_GetUnits() if units = 3 then call ppm_SetUnits(2) currentoffset = ppm_GetDMOffset() signal on halt signal on break_c signal on break_e signal on break_d cu = "in" if units = 2 then cu = "cm" call ppm_AutoUpdate(0) trace n source = ppm_Inform(3,"Données ...","Identiques","Saisissez les","Fichier") totalpages = ppm_Numpages() formstring = "" if source = 0 then do if open("temp","ram:offprint.data","R") then do formstring = readch("temp",512) call close("temp") end if formstring = "" then source = 1 /* defaults if failed */ end /* source = 0 */ if source = 2 then do loadfile = ppm_GetFileName("Chargement des Données","","") if loadfile = "" then break if open("loader",loadfile,"R") then do formstring = readch("loader",512) call close("loader") end if formstring = "" then source = 1 /* go for defaults */ end if formstring = "" then formstring ="Origine X, p.1 ("cu"):0"||cr"Origine Y, p.1 ("cu"):0"||cr||"Origine X, p.2 ("cu"):0"||cr"Origine Y, p.2 ("cu"):0"||cr"Sauve Données (O/N):N" form = ppm_GetForm("Imprime Avec Offsets", 12, formstring) if form = '' then exit_msg("Abandon") parse var form Xoffset1 '0a'x Yoffset1 '0a'x Xoffset2 '0a'x Yoffset2 '0a'x Saving if Xoffset1 = '' then Xoffset1 = 0 if Yoffset1 = '' then Yoffset1 = 0 if Xoffset2 = '' then Xoffset2 = 0 if Yoffset2 = '' then Yoffset2 = 0 saving = upper(saving) if saving ~= 'O' then saving = "N" if ~(datatype(Xoffset1, n)) then exit_msg("Saisie Invalide pour Origine X, p.1 : "Xoffset1) if ~(datatype(Yoffset1, n)) then exit_msg("Saisie Invalide pour Origine Y, p.1 : "Yoffset1) if ~(datatype(Xoffset2, n)) then exit_msg("Saisie Invalide pour Origine X, p.2 : "Xoffset2) if ~(datatype(Yoffset2, n)) then exit_msg("Saisie Invalide pour Origine Y, p.2 : "Yoffset2) formstring ="Origine X, p.1 ("cu"):"Xoffset1||cr"Origine Y, p.1 ("cu"):"Yoffset1||cr||"Origine X, p.2 ("cu"):"Xoffset2||cr"Origine Y, p.2 ("cu"):"Yoffset2||cr"Sauve Données (O/N):"saving if open("temp","ram:offprint.data","W") then do call seek("temp",0,"B") call writech("temp",formstring) call close("temp") end if upper(Saving) = "O" then do savefile = ppm_GetFileName("Sauvegarde des Données","","") if savefile = "" then break if open("saver",savefile,"W") then do call writech("saver",formstring) call close("saver") end end do i=1 to totalpages call ppm_SetDMOffset(Xoffset1, Yoffset1) call ppm_ShowStatus("Impression de la Page "i) call ppm_PrintPageDM(i,1,1) i=i+1 if i>totalpages then break call ppm_ShowStatus("Impression de la Page "i) call ppm_SetDMOffset(Xoffset2, Yoffset2) call ppm_PrintPageDM(i,1,1) end call ppm_SetDMOffset(word(currentoffset,1), word(currentoffset,2)) call exit_msg("Terminé") break_d: break_e: break_c: halt: call exit_msg("Arrêt du Génie par l'Utilisateur") exit_msg: procedure expose units do parse arg message if message ~= '' then call ppm_Inform(1, message,) call ppm_ClearStatus() call ppm_SetUnits(units) call ppm_AutoUpdate(1) exit end