// Ŀ // // PRINT2D.VDM (C) 03.94 EBG Bochum // last change: 26.09.96 Informatik // formatierte Druck- Christian Ziemski // Ausgabe von Texten Version: 2.31 // VEDIT-PLUS: 4.22 // // Ĵ // Description: // ------------ // // (basiert auf PRINT.VDM von Greenview) // // wird von PFORM.BAT aufgerufen ! (--> siehe dort !) // // erwartet die Umgebungsvariable FILENAME mit dem zu druckenden // Dateinamen. // mgl. Anzahl Zeilen/Seite wird bei Aufruf konfiguriert. // mgl. Anzahl Zeichen/Zeile (ohne li. Rand) wird beim Aufruf bergeben. // // Ĵ // Register usage: // --------------- // // // Ĵ // to do: // ------ // // Register-Aufteilung berarbeiten // Register sichern/restoren // // Buf_Switch(33) // Datum und Uhrzeit fr Kopfzeile Out_Ins() Date( NOCR+NOMSG) Out_Ins(CLEAR) // aufbereiten Begin_Of_File() Replace("-",".",ALL) Reg_Copy_Block(97,3,6) Del_Block(3,6) Reg_Copy_Block(97,0,FSIZE,APPEND) Buf_Empty(OK) Reg_Ins(97) Ins_Text(" ") Out_Ins() Time(NOCR+NOMSG) Out_Ins(CLEAR) Reg_Copy_Block(97,0,FSIZE) Buf_Switch(1) BoF if ( Config(F_F_TYPE) == 1 ) { R(" "," ",ALL) Config(F_F_TYPE,0) } Get_Environment(98,"FILENAME") // Original-Dateiname (incl. Gro-/Klein) if ( Reg_Size(98) == 0 ) { // wenn kein Druckname vorh. Out_Reg(98) Name_Read(NOCR+NOMSG) Out_Reg(CLEAR) } Replace("|W|>","",NOERR+ALL+BEGIN) End_Of_File() // dem Text folgende Leerzeilen lschen Block_Begin(CLEAR) Block_Begin(Cur_Pos) Search("|!|L",REVERSE+NOERR) if ((!Error_Match)) { Char(1) Block_End(Cur_Pos) Del_Block(Block_Begin,Block_End,RESET) } Begin_Of_File() #1 = 1 // Set page counter to 1 #5 = Config(P_PAPER_L) // Q5 = number of physical lines per page #6 = N_Option // Zeichen/Zeile des Druckers (exkl. linken Rand !) repeat (ALL) { // Main loop if (At_EOF ) { Goto END } // Branch on End-of-file Ins_Char(13) // CR, damit Drucker wirklich am Zeilenanfang ist Out_Ins() Message("File: ") Reg_Type(98,0) // filename Tab_Out(48) // Tab-out to column 48 Reg_Type(97,0) // Datum und Uhrzeit einfgen Tab_Out(70) // Tab-out to column 60 Message("Seite ") Num_Type(#1,LEFT) // page number, left justified Message("") Type_Newline(2) // Newline and 1 more blank line Out_Ins(CLEAR) #7=1 // Zeilenzhler fr die akt. Seite repeat (ALL) { // all lines per page, 3 Zeilen Kopf, 1 Zeile Fu (leer) if (Cur_Char==12) { // new page if in 1st col. (u. Zeile lschen) Del_Line(1) Break } if (At_EOF ) { Goto END } // Branch on End-of-file Line(0) if(Match("|L")!=0){ DOV("\LE\") } #4=Cursor_Col-1 // => Zeilenlnge repeat(ALL){ if(#4>#6){ // wenn Zeilenlnge grer als max. #7+=1 // Zeilenzhler ++ #4-=#6 // restliche Lnge if(#7>=(#5-4)){ Break } // wenn max. Zeilen/Seite erreicht // (fr Lnge > 2x #6 geht das so nicht !!) }else{ // Line(0) Num_Ins(#7,NOCR) Line(1,NOERR) // Advance by 1 line Break } } if(#7>=(#5-4)){ Break } #7+=1 } // End of loop for one page if (At_EOF ) { Goto END } // Branch on End-of-file Ins_Char(12) // Seitenvorschub if (Cur_Char==12) { // Delete next char if it is a ; Del_Char() // prevents printing blank pages } #1 += 1 // Advance page counter } // END of main print loop :END: Out_Ins() Type_Newline() Type_Newline() Out_Ins(CLEAR) // Abstandszeile Ins_Text(" End of file ") Ins_Char(12) // Seitenvorschub Ins_Char(13) // CR, damit Drucker wirklich am Zeilenanfang ist : File_Save() QALLY // und Schluss