| QTIPS - Using @Upper.Case and @Lower.Case with Foreign Languages |
| @ATTACK - @Lower.Case |
| @ATTACK - @Upper.Case |
| Sorting out Collation Sequences by Mike Pope |
| QTIPS - Command Line Options |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Utility Diskette # 4 |
| Form.List.S |
| QTIPS - Aesthetically Improving RLIST Reports |
| QTIPS - Form Processor |
| QTIPS - Suppressing Initial Form Feed |
| QTIPS - Using RTP29 In Place of V6 |
| Gas Bar |
| @ATTACK - @Rn.Counter |
| QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT" |
| QTIPS - Inconsistent @Variable Behaviour |
| Playing with Scan Codes |
| QTIPS - Compiling Protection Code |
| QTIPS - Invalid Code and Command |
| QTIPS - Code/Command Help |
| Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd) |
| Reader's Clinic - Functions and Subroutines |
| Argument passing - Subroutines and Functions - Mike Pope |
| Background Processing |
| Creating Your Own Background Processes |
| @ATTACK - @Index.Time |
| How Indexes Are Updated |
| Creating Your Own Background Processes |
| @ATTACK - @Last.Select.Process |
| Reader's Forum |
| QTIPS - Menu Item Pre-Processing |
| SecureUser |
| VERBatim - V25 |
| @ATTACK - @Files.System |
| Advanced Revelation Initialisation Sequence (Overview) by Mike Pope |
| REVMEDIA Revisted |
| Simple Security |
| QTIPS - Hiding Symbolic Source Code |
| Using One Dictionary With Multiple Tables - Aaron Kaplan - SoftMart Inc |
RevMedia FKB
| Document | V1I5A4 |
| Title | Merge Processor |
| Keywords | MERGE PROCESSOR MAKEMERGE FONT PRINTER |
| Text | As the sophistication of our user base grows so does the sophistication of their demands A recent case in point was a client who had a twin bin feeder on their laser printer and who wanted a MERGE document to print first page on headed paper and then second page (and all subsequent pages) on continuation paper This obviously involved swapping printer bins WITH the appropriate escape sequence USING a < noticed pressing F10 when in the MAKEMERGE window gives you the MERGE menu and allows you to configure your printer etc ) The only problem WITH this approach was that issuing a swap bin command to the laser printer caused a form feed This in itself was not a problem but AREV was not aware that a page throw had occurred and thus continued printing until it reached the end of its logical page and then performed a form feed itself Thus if we were printing an 80 line document WITH a page length of 60 lines and we swapped bins AFTER 40 lines AREV printed a further 20 lines on the next page and then form fed to print the final 20 lines on the third page This was really inconvenient What was required was a < to RESET the line counter to 0 without printing a CHAR(12) Without access to source I can only suggest this as a possible enhancement so short term I developed a solution to work around this problem In the OBJECT code for MERGE is contained a literal about "to process" By experimenting I discovered that if you put a subroutine name preceded with an @ sign into the PRINTER field on the MERGE document (NB @Routine name NOT @S Routine name@) the partially formatted document is sent to your routine NOT to the printer The subroutine is passed two parameters the id of the record and the formatted text All of the printer control COMMANDS are left in< done We only need to process this data and ignore the form feeds applying our own page control logic In fact this has much wider application We could do ANYTHING WITH the output write it DIRECT to a WP file create a fax file for pickup by JT Fax anything In addition to the information passed DIRECTLY to the subroutine we also need access to an area of system LABELLED common called MERGE This labelled common area has 26 parameters (I E COMMON / MERGE / A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) which are as follows (where ??? is a variable of unknown usage) A Data File Name B Dictionary File Variable C ??? D Special Text Data File Name E Top Margin F Left Margin G Page Width (Left Margin + Right Margin) H Page Height (Top Margin + Bottom Margin) I DEFAULT FORMAT (Coded 0 = Noformat ! = Left 2 = filled) J Heading K Footing L Formatted text identical to second parameter passed M P ??? Q %FIELDS% of Data File R File VARIABLE of Special Text Data File S T ??? U Field MARK delimited list of command OPTIONS << >> < etc V Field mark delimited list of printer control codes < < W Special Merge Fields MRG DATE MRG TIME etc X < Y < Z < Thus our bin change logic could look something like (assuming HP DESKJET printer and bin changes in < tersity of code) SUBROUTINE PRINT MERGE(ID TEXT) COMMON /MERGE/ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z EQU PRN$ TO "HP DESKJET" EQU PAGE LEN$ TO 60 PRIN CODES = XLATE("MRG PRINTER CONFIG"'PRN$ "" "X") * Get control codes for bin changes CODE = "< CODE = "< CTR = COUNT(TEXT @FM) + (TEXT#"") FIRST PASS = 1 ; PRINTER ON ; PRINT BIN1 ; LINE CTR= 0 FOR LINE = 1 TO CTR CL =TEXT LOOP UNTIL NO MORE CHANGES DO QX = INDEX(CL "<<" 1) IF QX THEN CODE = CL[QX "F>>"] : ">>" ; S COL2 = COL2() IF CODE = "< GOSUB GET CODES END CL = CL[1 QX 1] : CODE : CL[S COL2+1 9999] END ELSE NO MORE CHANGES = 1 REPEAT PRINT CL ; LINE CTR += 1 IF LINE CTR = PAGE LEN$ THEN IF FIRST PASS THEN PRINT BIN2 ; FIRST PASS = 0 END ELSE PRINT CHAR(12) LINE CTR = 0 ; *Reset line count END NEXT PRINT CHAR(12) ; PRINTER OFF RETURN GET CODES: LOCATE CODE IN V USING @FM SETTING POS THEN CODES = "" NEW CTR = COUNT(PRIN CODES FOR BX = 1 TO NEW CTR CODES :=CHAR(FIELD(PRIN CODES NEXT END RETURN (Volume 1 Issue 5 Pages 4 9) |
Page last modified: 30/01/03