3 Column Printing

for the family using

GW-BASIC

Page 1 of the Last Book of GW-BASIC
Back to the GW-BASIC Table of Contents
All the way back to Frankenbook

All we are doing here is putting lines that are twenty-five
characters long side by side.  We read the lines into an
array and pick off the requisite line to send to the 
printer.  no big deal. but really, who needs it?  it is here
just mainly to show you that it can be done either in 
portrait or landscape mode.  For landscape just adjust the
line length and numbers of lines per page.

For a normal page of 54 lines there should be 162 lines of
little shorty lines. (25 characters/line) Empty column lines
are just missing data lines within the loaded array.  Yawn...
handy stuff...  here i swiped that test data from the label
program.  getting lazy...

10   ' a three column page blank by fhb4family
20 DATA "1Dear Sirs:              "
30 DATA "2                        "
40 DATA "3this letter is a test   "
50 DATA "4letter to show you how  "
60 DATA "5you can use GW-BASIC to "
70 DATA "6write a nice 3 column   "
80 DATA "7letter to someone who is"
90 DATA "8not to picky about just "
100 DATA "9ow bad the three column "
110 DATA "10letter looks.          "
120 DATA "11                       "
130 DATA "3 2LLLLLLLLLLLLLLLLLLLLLL"
140 DATA "3 3456789 123456789 12345"
150 DATA "3 4LLLLLLLLLLLLLLLLLLLLLL"
160 DATA "B3                       "
170 DATA "T4                       "
180 DATA "4 2LLLLLLLLLLLLLLLLLLLLLL"
190 DATA "4 3356789 123456789 12345"
200 DATA "4 4LLLLLLLLLLLLLLLLLLLLLL"
210 DATA "B4                       "
220 DATA "T5                       "
230 DATA "5 2LLLLLLLLLLLLLLLLLLLLLL"
240 DATA "5 3456789 123456789 12345"
250 DATA "5 4LLLLLLLLLLLLLLLLLLLLLL"
260 DATA "B5                       "
270 DATA "T6                       "
280 DATA "6 2LLLLLLLLLLLLLLLLLLLLLL"
290 DATA "6 3456789 123456789 12345"
300 DATA "6 4LLLLLLLLLLLLLLLLLLLLLL"
310 DATA "B6                       "
320 DATA "T7                       "
330 DATA "7 2LLLLLLLLLLLLLLLLLLLLLL"
340 DATA "7 3456789 123456789 12345"
350 DATA "7 4LLLLLLLLLLLLLLLLLLLLLL"
360 DATA "B7                       "
370 DATA "T8                       "
380 DATA "8 2LLLLLLLLLLLLLLLLLLLLLL"
390 DATA "8 3456789 123456789 12345"
400 DATA "8 4LLLLLLLLLLLLLLLLLLLLLL"
410 DATA "B8                       "
420 DATA "T9                       "
430 DATA "9 2LLLLLLLLLLLLLLLLLLLLLL"
440 DATA "9 3456789 123456789 12345"
450 DATA "9 4LLLLLLLLLLLLLLLLLLLLLL"
460 DATA "B9                       "
470 DATA "T10                      "
480 DATA "10 2LLLLLLLLLLLLLLLLLLLLL"
490 DATA "10 356789 123456789 12345"
500 DATA "10 4LLLLLLLLLLLLLLLLLLLLL"
510 DATA "B10                      "
520 DATA "T11                      "
530 DATA "11 2LLLLLLLLLLLLLLLLLLLLL"
540 DATA "11 356789 123456789 12345"
550 DATA "11 4LLLLLLLLLLLLLLLLLLLLL"
560 DATA "B11                      "
570 DATA "T12                      "
580 DATA "12 2LLLLLLLLLLLLLLLLLLLLL"
590 DATA "12 356789 123456789 12345"
600 DATA "12 4LLLLLLLLLLLLLLLLLLLLL"
610 DATA "B12                      "
620 DATA "T13                      "
630 DATA "13 2LLLLLLLLLLLLLLLLLLLLL"
640 DATA "13 356789 123456789 12345"
650 DATA "13 4LLLLLLLLLLLLLLLLLLLLL"
660 DATA "B13                      "
670 DATA "T14                      "
680 DATA "14 2LLLLLLLLLLLLLLLLLLLLL"
690 DATA "14 356789 123456789 12345"
700 DATA "14 4LLLLLLLLLLLLLLLLLLLLL"
710 DATA "B14                      "
720 DATA "T15                      "
730 DATA "15 2LLLLLLLLLLLLLLLLLLLLL"
740 DATA "15 356789 123456789 12345"
750 DATA "15 4LLLLLLLLLLLLLLLLLLLLL"
760 DATA "B15                      "
770 DATA "T16                      "
780 DATA "16 2LLLLLLLLLLLLLLLLLLLLL"
790 DATA "16 356789 123456789 12345"
800 DATA "16 4LLLLLLLLLLLLLLLLLLLLL"
810 DATA "B16                      "
820 DATA "T17                      "
830 DATA "17 2LLLLLLLLLLLLLLLLLLLLL"
840 DATA "17 356789 123456789 12345"
850 DATA "17 4LLLLLLLLLLLLLLLLLLLLL"
860 DATA "B17                      "
870 DATA "T18                      "
880 DATA "18 2LLLLLLLLLLLLLLLLLLLLL"
890 DATA "18 356789 123456789 12345"
900 DATA "18 4LLLLLLLLLLLLLLLLLLLLL"
910 DATA "B18                      "
920 DATA "T19                      "
930 DATA "19 2LLLLLLLLLLLLLLLLLLLLL"
940 DATA "19 356789 123456789 12345"
950 DATA "19 4LLLLLLLLLLLLLLLLLLLLL"
960 DATA "B19                      "
970 DATA "T20                      "
980 DATA "20 2LLLLLLLLLLLLLLLLLLLLL"
990 DATA "20 356789 123456789 12345"
1000 DATA "20 4LLLLLLLLLLLLLLLLLLLLL"
1010 DATA "B20                      "
1020 DATA "T21                      "
1030 DATA "21 2LLLLLLLLLLLLLLLLLLLLL"
1040 DATA "21 356789 123456789 12345"
1050 DATA "21 4LLLLLLLLLLLLLLLLLLLLL"
1060 DATA "B21                      "
1070 DATA "T22                      "
1080 DATA "22 2LLLLLLLLLLLLLLLLLLLLL"
1090 DATA "22 356789 123456789 12345"
1100 DATA "22 4LLLLLLLLLLLLLLLLLLLLL"
1110 DATA "B22                      "
1120 DATA "T23                      "
1130 DATA "23 2LLLLLLLLLLLLLLLLLLLLL"
1140 DATA "23 356789 123456789 12345"
1150 DATA "23 4LLLLLLLLLLLLLLLLLLLLL"
1160 DATA "B23                      "
1170 DATA "T24                      "
1180 DATA "24 2LLLLLLLLLLLLLLLLLLLLL"
1190 DATA "24 356789 123456789 12345"
1200 DATA "24 4LLLLLLLLLLLLLLLLLLLLL"
1210 DATA "B24                      "
1220 DATA "T25                      "
1230 DATA "25 2LLLLLLLLLLLLLLLLLLLLL"
1240 DATA "25 356789 123456789 12345"
1250 DATA "25 4LLLLLLLLLLLLLLLLLLLLL"
1260 DATA "B25                      "
1270 DATA "T26                      "
1280 DATA "26 2LLLLLLLLLLLLLLLLLLLLL"
1290 DATA "26 356789 123456789 12345"
1300 DATA "26 4LLLLLLLLLLLLLLLLLLLLL"
1310 DATA "B26                      "
1320 DATA "T27                      "
1330 DATA "27 2LLLLLLLLLLLLLLLLLLLLL"
1340 DATA "27 356789 123456789 12345"
1350 DATA "27 4LLLLLLLLLLLLLLLLLLLLL"
1360 DATA "B27                      "
1370 DATA "T28                      "
1380 DATA "28 2LLLLLLLLLLLLLLLLLLLLL"
1390 DATA "28 356789 123456789 12345"
1400 DATA "28 4LLLLLLLLLLLLLLLLLLLLL"
1410 DATA "B28                      "
1420 DATA "T29                      "
1430 DATA "29 2LLLLLLLLLLLLLLLLLLLLL"
1440 DATA "29 356789 123456789 12345"
1450 DATA "29 4LLLLLLLLLLLLLLLLLLLLL"
1460 DATA "B29                      "
1470 DATA "T30                      "
1480 DATA "30 2LLLLLLLLLLLLLLLLLLLLL"
1490 DATA "30 346789 123456789 12345"
1500 DATA "30 346789 123456789 12345"
1510 DATA "30 346789 123456789 12345"
1520 DATA "30 346789 123456789 12345"
1530 DATA "30 346789 123456789 12345"
1540 DATA "30 4LLLLLLLLLLLLLLLLLLLLL"
1550 DATA "30 4LLLLLLLLLLLLLLLLLLLLL"
1560 DATA "When in the course of old"
1570 DATA "human events it becomes a"
1580 DATA "good idea to take a nap  "
1590 DATA "one should always look at"
1600 DATA "a nice quite spot to try "
1610 DATA "and snooze.              "
1620 DATA "                         "
1630 DATA "Respectfully, Joe Sixpack"
1640 'End of data statements
1650 '
1660 '======3 column page program starts here================
1670 '
1680 '3ColumnProgramStartsHere:
1690 GOSUB 1740   'VariableAssignments
1700 GOSUB 1810   'load 150 data elements into array A$(150)
1710 GOSUB 1890   'Print3ColumnSentences
1720 END          'end of the program...
1730 '
1740 'VariableAssignments:
1750 DIM A$(162)   'create string array that holds sentence data
1760 T1=1          'set first column tab
1770 T2=28         'set second column tab
1780 T3=55         'set third column tab
1790 RETURN' to program
1800 '
1810 'LoadColumnData:
1820 I=1           'set counter I to 1
1830 WHILE I<163   'set incrementing parameter
1840   READ A$(I)  'load the sentence lines (data)into the array
1850   I=I+1       'increment the counter
1860   WEND        '^^^^^^^^^^^^^^^loop to load sentences into array
1870 RETURN 'to program
1880 '
1890 'Print3ColumnSentences:
1900 I=1           'reset counter to 1 again for 2nd while-wend loop
1910 WHILE I<55    'set incrementing parameter for a 54 line page
1920   PRINT TAB(T1) A$(I);    'To print sentences, change the three
1930   PRINT TAB(T2) A$(I+54); 'PRINT statements to LPRINT.
1940   PRINT TAB(T3) A$(I+108) 'program prints 1 page.
1950   I=I+1
1960 WEND   '^^^^^^^^^^^^^^^^loop thru data to print column page
1970 '
1980 '=================embedded commands section================
1990 'Data Editing Roadmap:
2000 '  cls: list 20-210    'edit
2010 '  cls: list 220-410   'edit
2020 '  cls: list 420-610   'edit
2030 '  cls: list 620-810   'edit
2040 '  cls: list 820-1010  'edit
2050 '  cls: list 1020-1210 'edit
2060 '  cls: list 1220-1410 'edit
2070 '  cls: list 1420-1510 'edit
2080 'Subroutine Editing Roadmap:
2090 '  cls: list 1730-1800 'VariableAssignments
2100 '  cls: list 1800-1880 'LoadSentenceData
2110 '  cls: list 1880-1970 'Print3ColumnSentencePage
2120 'OtherEmbeddedCommands:
2130 '  save "3column.bas",a 'save the program in ASCII mode
2140 '  cls: list 1970-2150 'Subroutine Editing Roadmap
2150 '

By the way, notice in the code i use the phrase, 
"incrementing parameter"...  i have no idea what an 
"incrementing parameter" is or why that one spilled out of 
my tiny little senile brain.  All we are really doing is 
just setting a limit to the number of times we can read the 
data from the sentences which we tuck into an array for 
later printing.  Incrementing parameter.... sheesh...


TOP
Index
TOC
Hosted by www.Geocities.ws

1