BI-COLUMNIFIER

Developer(s): Mike Padlipsky, Peter Hale
Date: 1988
Type: Diskette
Platform(s): QL
Tags: Printer

Prints a Quill _lis file as two columns to a page on an Epson-compatible printer from the Sinclair QL, or to a _col file. Menus choose the character width (double wide, pica, elite, condensed), italic, proportional spacing and near-letter-quality or double-strike printing; the cursor keys then adjust the left margin and the column separator while the text-frame width is shown in inches.

Set the Quill document’s left margin to zero, no header or footer, and end it with a line holding only CTRL-SHIFT-K. Remove any printer reset (ESC @) from the printer_dat preamble. Needs Toolkit II for DIR in line 1390 (the REMarks say how to edit it out). Type s to save it as flp2_Bi_col_bas. Peter Hale wrote this version on Mike Padlipsky’s method; the REMarks ask for attribution.

The record also holds colify, Mike Padlipsky’s short “lazyman’s” version from the same article (colify_bas): it reads a Quill document printed to flp2_colify_lis (no more than 66 characters wide, with a non-zero margin that becomes the column gap, padded with page breaks to an even number of pages) and prints it in two columns of double-strike condensed type, 66 lines to a column. It runs off the end of the file by design; close the channels by hand.

Corrected so it can be entered: line 2020 ends the procedure s with END DEFine s; the print has END PROCedure s.

Published in the BCS Sinclair-Timex User Group Newsletter September/October 1988 (Columnifying Quill).

Source Code

BI-COLUMNIFIER (Bi_col_bas)

1 REMark      BI-COLUMNIFIER
2 REMark    Prints a _lis file
3 REMark as two columns to a page
5 REMark    by  Mike Padlipsky
7 REMark       & Peter Hale
8 REMark Sinclair/Timex User Group
9 REMark  Boston Computer Society
10 REMark    One Center Plaza
11 REMark    Boston, MA 02108
13 REMark  Attribution requested
14 :
15 REMark Progam assumes Epson compatible printer codes
16 REMark See line 1500 & ff for codes needing changes
17 :
100 init: open_file: char_col_line: CHAR_wid: CHAR_2: verify
110 print_file: PRINT_col
120 CSIZE 3,0: AT 20,5: INK 0: PRINT "¡ FINIS !"
130 BEEP 0,50: PAUSE (150): BEEP: STOP
140 :
150 DEFine PROCedure gky
160  an$=INKEY$(-1): an=CODE(an$): PRINT!an$
170 END DEFine gky
180 :
200 DEFine PROCedure init
210  WINDOW 512,256,0,0: INK 6: PAPER 2: CLS: CSIZE 3,1
220  WINDOW 312,220,15,0: BORDER 2,6: CLS: AT 4,2
230  PRINT "BI-COLUMNIFIER": CSIZE 1,0
240  PRINT\"   by Mike Padlipsky & Peter Hale"
250  PRINT\\\,"Press <SPACE> to run": PAUSE: CLS
260  k=0: mar=0: tb=4: r=1: n$=CHR$(0): p$=n$: t$=n$: w$=n$
270  c_i=5: typ$="Standard ": nlq$="Draft": spc$=typ$
280 END DEFine init
290 :
300 DEFine PROCedure char_col_line
310  PRINT\"  Enter number of characters per"
320  INPUT "  line in original text:"!c_c_l$ : c_c_l=c_c_l$
330  IF c_c_l>66
340   PRINT\" "!c_c_l!"characters too wide to"
350   PRINT "  bi-columize the document."
360   PRINT "  66 is maximum for condensed type."
370   PRINT\"  Re-do your document.": STOP
380  END IF
390 END DEFine char_col_line
400 :
500 DEFine PROCedure CHAR_wid
510  PRINT\"  Select character width": PRINT
520  IF c_c_l<19 THEN PRINT,"<D> ouble wide"
530  IF c_c_l<39 THEN PRINT,"<S> tandard (Pica)"
540  IF c_c_l<47 THEN PRINT,"<E> lite"
550  IF c_c_l<67 THEN PRINT,"<C> ondensed"
560  PRINT\"  Enter choice (d/s/e/c)";: gky
570  SELect ON an
580   =68,100: w$=CHR$(27)&"W"&CHR$(1): wid$="Double Wide"
590   =80,112,83,115: wid$="Pica": c_i=10
600   =69,101: w$=CHR$(27)&"M": wid$="Elite": c_i=12
610   =67,99: w$=CHR$(15): wid$="Condensed": c_i=17
620   =REMAINDER : CLS: RUN
630  END SELect
640 END DEFine CHAR_wid
650 :
700 DEFine PROCedure CHAR_2
710  PRINT\"  Italic character type? (y/n)";: gky
720  IF an$=="y" THEN t$=CHR$(27)&"4": typ$="Italic"
730  IF c_i<12
740   PRINT\"  Proportional spacing? (y/n)";: gky
750   IF an$=="y"
760    p$=CHR$(27)&"p"&CHR$(1): spc$="Propor'l ": r=1.1
770   END IF : END IF
780  spc$=spc$&(c_i*r)&" char/inch"
790  PRINT\"  N.L.Q. Printing mode? (y/n)";: gky
800  IF an$=="y" THEN
810   REMark c_i<12 if your Epson can't do NLQ in elite
820   IF c_i<17
830    n$=CHR$(27)&"x"&CHR$(1): nlq$="Near Letter Quality"
840   ELSE
850    n$=CHR$(27)&"G": nlq$="Double Strike"
860   END IF : END IF : CLS
870  c_l=c_c_l/r: tab=INT(tb*r+c_l): d_f=INT(10*(tab+c_l)/c_i+.5)
880 END DEFine CHAR_2
890 :
900 DEFine PROCedure verify
910  PRINT,"  DOCUMENT FORMAT"
920  PRINT\"  Char fount",typ$
930  PRINT "  Char size",wid$
940  PRINT "  Spacing",spc$
950  PRINT "  Text frame",d_f/10!"inches"
960  PRINT "  Printing mode",nlq$
970  PRINT\"   Left  Char/ Column  Rel tab Text"
980  PRINT "  Margin line  Sep'tr position frame"
990  PRINT\"   ← →           ↑ ↓"
1000  PRINT\TO 7;"Press cursors to adjust"\TO 11;"<ENTER>  to set"
1010  REPeat loop
1030   AT 10,4: PRINT mar,!!c_c_l,!tb,!tab!!!!!d_f/10;""
1040   PAUSE: an=KEYROW(1)
1050   SELect ON an
1060    =2: mar=mar-1
1070    =16: mar=mar+1
1080    =4: tb=tb+1
1090    =128: tb=tb-1
1100    =1: EXIT loop
1110    =REMAINDER
1120   END SELect
1130   tab=INT(tb*r+c_l): d_f=INT(10*(tab+c_l)/c_i+.5)
1140   AT 12,6: PRINT FILL$(" ",25)
1150   IF mar<0 OR (mar*10/c_i+d_f)/10>8 OR tb<3
1160    AT 12,6: INK 0: PAPER 6
1170    PRINT " Out of range; try again ": INK 6: PAPER 2
1180   END IF
1190  END REPeat loop
1200  AT 16,7: PRINT "Is this correct?  (y/n)";: gky
1210  IF an$=="y" THEN RETurn verify
1220  PRINT "  Then you must rework your Quill doc"
1230  PRINT\"  Exit to rework Quill doc? (y/n)";: gky
1240  IF an$=="y" THEN CLS: STOP
1250  PRINT " Try another document format? (y/n)";: gky: CLS
1260  IF an$=="y" THEN GO TO 100: ELSE : STOP
1270 END DEFine verify
1280 :
1300 DEFine PROCedure open_file
1310  OPEN #5,con: WINDOW #5,120,256,330,0: BORDER #5,2,4
1320  INK #5,6: PAPER #5,0: CLS #5
1330  INPUT #5,\"   Document on"\\"   DRIVE?"!dv$
1340  IF LEN(dv$)=1 THEN dv$="flp"&dv$
1350  REMark Number of fields = 66 lines/page
1360  REMark Field length = 99 columns
1370  DIM lcol$(66,99): DIM rcol$(66,99)
1380  IF dv$(LEN (dv$))<>"_" THEN dv$=dv$&"_"
1390  DIR #5,dv$&"_lis": INPUT #5,\" Select _Lis"\\" FILE:"!file$
1400  REMark Line 1390 uses Toolkit II DIR ability display only files
1410  REMark that end in "_lis".  You may have to edit out &"_lis"
1420  IF NOT "_" INSTR file$ THEN file$=file$&"_lis"
1430  LET temp$=dv$&file$(1 TO ( "_" INSTR file$))&"col"
1440 END DEFine open_file
1450 :
1500 DEFine PROCedure PRINT_col
1510  REMark Printer control codes are for Epson printer
1520  REMark You may have to change for other printers
1530  PRINT #4,CHR$(27)&"@";: REMark printer reset
1540  IF n$<>CHR$(0) THEN PRINT #4,n$;: REMark See Lines 830/850
1550  IF p$<>CHR$(0) THEN PRINT #4,p$;: REMark See Line 760
1560  IF t$<>CHR$(0) THEN PRINT #4,t$;: REMark See Line 720
1570  IF w$<>CHR$(0) THEN PRINT #4,w$;: REMark See Lines 580 to 610
1580  REMark Following line sets left margin, then horizontal tab
1590  REMark "IF an$<>'f'" and 1610 to reimport file to Quill
1600  PRINT #4,CHR$(27)&"l"&CHR$(mar)&CHR$(27)&"D"&CHR$(tab)&CHR$(0);
1610  REMark END IF
1620  REPeat col_PRINT
1630   FOR i=1 TO 66
1640    INPUT #3,lcol$(i)
1650    j=CHR$(13) INSTR lcol$(i)
1660    lcol$(i,j)=CHR$(9)
1670    REMark Œ=CTRL SHIFT K
1680    IF "Œ" INSTR lcol$(i) THEN k=i: EXIT i
1690   END FOR i
1700   IF k: FOR i=k TO 66: lcol$(i)=CHR$(9)
1710   IF NOT k
1720    FOR i=1 TO 66
1730     INPUT #3,rcol$(i)
1740    IF "Œ" INSTR rcol$(i) THEN k=i: EXIT i
1750    END FOR i
1760   END IF
1770   IF k: FOR i=k TO 66: rcol$(i)=CHR$(13)
1780   FOR i=1 TO 66: PRINT #4,lcol$(i);rcol$(i)
1790   IF k THEN EXIT col_PRINT
1800  END REPeat col_PRINT
1810  CLOSE #3: PRINT #4,CHR$(27)&"@";: CLOSE #4: CLOSE #5
1820 END DEFine PRINT_col
1830 :
1900 DEFine PROCedure print_file
1910  PRINT\"  Print to Paper or File (p/f)";: gky
1920  IF an$=="p" THEN OPEN #4,ser1: ELSE an$="f"
1930  OPEN_IN #3,dv$&file$: PRINT #5,\dv$&file$\"  will be printed"
1940  IF an$='f' THEN PRINT #5,"  as:"!temp$: OPEN_NEW #4,temp$
1950  PRINT #5,\\"    PATIENCE!"
1960 END DEFine print_fila
1970:
2000 DEFine PROCedure s
2010  DELETE flp2_Bi_col_bas: SAVE flp2_Bi_col_bas
2020 END DEFine s

colify, Mike Padlipsky's short version (colify_bas)

110 DIM lcol$(66,80)
120 DIM rcol$(66,80)
130 OPEN_IN #3,'flp2_colify_lis'
140 OPEN #4,'ser1'
150 PRINT #4,CHR$(27);'@'; CHR$(27);'G';CHR$(15); CHR$(27);'D';'B';CHR$(0);
160 FOR i=1 TO 66
170  INPUT #3, lcol$(i)
175  j=CHR$(13) INSTR lcol$(i)
180  lcol$(i,j)=CHR$(9)
190 END FOR i
200 FOR i=1 TO 66: INPUT #3, rcol$(i)
210 FOR i=1 TO 66: PRINT #4, lcol$(i) & rcol$(i)
220 GO TO 160

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.