home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1987 March & April
/
rerun-1987-03-04.d64
/
dfprint
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
15KB
|
469 lines
10 iffl=0thenfl=1:load"dp] dos5.1",8,1
11 iffl=1thenfl=2:sys52224:rem(c)commodore
600 fore=0to24:poke54272+e,0:next:poke54296,15:goto1500
602 poke54277,58:poke54278,16:poke54273,35:poke54272,134
604 poke54276,33:fore=1to100:next:poke54276,16:return
1500 rem dfprint 1.7 for datafile (c)1983-1986 by mike konshak
1502 clr:print"[147][158]":poke53281,0:poke53280,0:open4,4:open3,3
1504 d$="":b$=chr$(32):forj=1to80:s$=s$+b$:nextj:pf=4:mf$=d$:rf$=d$:p=0
1506 nc=0:nl=0:pl=0:f1=0:f2=0:f3=0:l$=d$:rl=0:sb$=d$:cr$=chr$(13)
1508 a$=d$:c$=d$:t%=6:i=0:j=0:k=0:m=0:n=0:rw=5:sf=0:z=0:e$="eof"
1510 en=0:em$=d$:et=0:es=0:a1$=d$:a2$=d$:a3$=d$:rw=5:lw=34:lt=1:l=0
1512 rem-arrays
1514 dim ml$(17,4),pc(18),tt$(5),hc$(17),rp$(17,4),lp(5),r$(5)
1516 dim f$(31),t%(31),l%(31),rec$(31)
1518 lp(1)=1:lp(2)=37:lp(3)=73:lp(4)=109:goto1530
1520 rem-get
1521 print"[158] press the appropriate key ":return
1522 geta$:ifa$=""then1522
1524 return
1526 rem-start
1528 print"[147] datafile fast print program ":goto1548
1530 print"[147] datafile fast print rev 1.7 "
1532 print" by mike konshak (c)1986 "
1534 print"[153] this program will format and print a"
1536 print" seq[146] file, which was previously created"
1539 print" by [158]datafile[153][146], directly from the disk"
1540 print" to the printer. the order of the"
1542 print" records will be the same as the most"
1544 print" recent sort as written in the current"
1546 print" file.":print"[158] press any key[146][158] to continue"
1547 gosub1522:gosub2856:goto1528
1548 printtab(5)"o[153][146]pen record file on disk"
1550 iffl>0thenprinttab(5)"r[153][146]epeat record file: [146]"nf$"[158][146]"
1551 printtab(5)"$[153][146] disk directory 4[153][146]"
1552 printtab(5)"q[153][146]uit program"
1553 print" transfer to:"
1554 printtab(5)"d[153][146] datafile dbms"
1555 printtab(5)"c[153][146] dfcalc calculated reports"
1556 gosub1521
1558 gosub1522:ifa$="$"ora$="4"thengosub1628:goto1528
1559 ifa$="d"thenprint"[147][144]load"chr$(34)"datafile 3.6"chr$(34)",8":goto1565
1560 ifa$="o"thenfl=1:goto1572
1561 ifa$="c"thenprint"[147][144]load"chr$(34)"dfcalc"chr$(34)",8":goto1565
1562 ifa$="r"then1584
1563 ifa$="q"thenclose5:close15:close3:close4:end
1564 gosub602:goto1558
1565 print:print:print:print:print"run[158]"
1566 poke631,19:poke632,13:poke633,13:poke634,13:poke635,13:poke636,13
1568 poke198,6:new:end
1570 rem-file name
1572 print"[153][147] available record files are:[158]":@"$0:df]*"
1573 print"[153]name of record file to be printed[158]"
1574 print" ";nf$:input"[145] ";nf$:ifnf$=""thenfl=0:goto1528
1576 open15,8,15
1578 open5,8,5,"0:df] "+nf$+",s,r":gosub1618:ifen=62thengosub1620:fl=0:goto1528
1579 input#5,r,f,x:gosub1618:ifet=8then1528
1580 forn=1tof:input#5,f$(n),l%(n):nextn:gosub1618:ifet=8then1528
1582 close5:close15
1583 rem-print menu
1584 print"[158][147] record printout menu "
1585 print"[153] print options:";:ifk<>0thenprint:goto1587
1586 print"[150]no formats present[158]"
1587 printtab(4)"u[153][146]nformatted list"
1588 printtab(4)"r[153][146]eport format [158]"rf$
1590 printtab(4)"m[153][146]ailing labels [158]"mf$
1591 print"[153] configure:"
1592 printtab(4)"l[153][146]abels:[158]"rw"[153]rows,[158]"lw"[153]chrs,[158]"lt"[153]across"
1594 printtab(4)"p[153][146]rinter: option[158]"p;:ifp=4thenprint"[157][157]screen[146]";
1595 print:printtab(4)"$[153][146] disk directory 4[153][146]"
1596 printtab(4)"e[153][146]xit to restart"
1598 gosub1521
1600 gosub1522:ifa$="" then1600
1602 ifa$="u"thenk=1:goto1730
1604 ifa$="r"thenk=2:goto3118
1605 ifa$="$"ora$="4"thengosub1628:goto1584
1606 ifa$="e"then1528
1608 ifa$="m"thenk=3:goto3118
1610 ifa$="l"then1940
1612 ifa$="p"thengosub2856:goto1584
1614 gosub602:goto1600
1616 rem-disk error
1618 input#15,en,em$,et,es:if(en<20)or(en=62)thenet=0:return
1620 print" [150]disk error[146]"en"[157], "em$","et"[157],"es"[158]":et=8
1622 print"[153] press any key[153][146] to restart program[158]"
1624 gosub1522:close5:close15:return
1626 rem-directory
1628 print"[147][158]";:@"$":printtab(25)"[153]press any key[158][146]":gosub1522:return
1666 rem-load report
1668 print"[153][147] available report files are[158]:":@"$0:rp]*"
1669 print"[153] name of report format file?[158]"
1670 print" [158]";nf$:input"[145] ";rf$:ifrf$=""then1528
1672 open15,8,15:open5,8,5,"0:rp] "+rf$+",s,r":gosub1618:ifet=8then1528
1674 ifen=62thengosub1620:goto1528
1676 input#5,pw,nl,nc:gosub1618:ifet=8then1528
1678 forj=1tonl
1680 input#5,tt$(j):gosub1618:ifet=8then1528
1682 nextj
1684 fori=1tonc
1686 input#5,pc(i),hc$(i):gosub1618:ifet=8then1528
1688 forn=1to3
1690 input#5,rp$(i,n):gosub1618:ifet=8then1528
1692 nextn:nexti:input#5,a1$:z=val(a1$)
1694 s=st:ifs<>0then1698
1696 input#5,e$
1698 close5:close15
1700 goto2980
1702 rem-load label
1704 print"[153][147] available label files are:[158]":@"$0:ml]*"
1705 print"[153] name of mailing label format file?"
1706 print" [158]";nf$:input"[145] ";mf$:ifmf$=""then1528
1708 open15,8,15:open5,8,5,"0:ml] "+mf$+",s,r":gosub1618:ifet=8then1528
1710 ifen=62thengosub1620:goto1528
1712 input#5,rw
1714 fori=1torw:forn=1to3
1716 input#5,ml$(i,n):gosub1618:ifet=8then1528
1718 nextn
1720 nexti
1722 s=st:ifs<>0then1726
1724 input#5,e$
1726 close5:close15:goto3068
1728 rem-open file
1730 print"[147] positioning drive..."
1731 open15,8,15:open5,8,5,"0:df] "+nf$+",s,r":gosub1618:ifet=8then1528
1732 ifen=62thengosub1620:goto1528
1734 input#5,r,f,x:gosub1618:ifet=8then1528
1738 forn=1tof:input#5,f$(n),l%(n):nextn:gosub1618:ifet=8then1528
1740 rem-options
1742 a0=0:pg=1:pl=0:l=0:print"[147] [158] print options menu "
1743 print"[153] there are [158]"x"[146][153]records in [158]"nf$
1744 printtab(4)"a[153][146]ll records in file
1746 [153][163]4)"fprintwaitind records with common fields
1748 ifk=3andpf=4thenprinttab(4)"t[153][146]est label(s)"
1750 printtab(4)"e[153][146]xit back to start"
1752 ifk=2thenprint"[153]position paper in printer at top of page"
1754 gosub1521
1756 gosub1522
1758 ifa$="a"then1806
1762 ifa$="t"then1918
1764 ifa$="f"then1772
1766 ifa$="e"thenclose5:close15:goto3118
1768 gosub602:goto1756
1770 rem-find
1772 print"[158][147] find records with common items "
1774 forn=1tof:print" ";n;"[153][146] ";f$(n):nextn
1776 input" which field is to be searched";sf
1778 ifsf<0orsf>fthenprint"[145][145][145]":goto1776
1780 print"[153] enter common item[153][146] ":print" (the entire string is not required)"
1782 print" ";f$(sf);"[158][146] ";:inputt$
1784 print"[147]":ifk=2thengosub1838:gosub1852
1786 fori=1tox
1788 ifp<>4thenprint" searching record";i;"[145][145]"
1790 forn=1tof:input#5,rec$(n):ifrec$(n)=">"thenrec$(n)=" "
1791 nextn:gosub1618:ifet=8then1528
1792 ift$=left$(rec$(sf),len(t$))thenonkgosub1826,1870,1928:ifk=2thengosub1904
1796 nexti
1797 ifl>0andk=3thengosub1936
1798 close5:close15
1800 ifk=2then1906
1801 ifp=4thenprint"[153]press any key[158][146]":gosub1522
1802 goto1730
1804 rem-print all
1806 gosub2898:pl=0:print"[147][158]":ifp<>4andk=2thenprint"[147] printing heading"
1807 ifk=2thengosub1838:gosub1852
1808 fori=stox:ifp<>4thenprint"[145] reading record #"str$(i)" of"str$(x)
1810 forn=1tof:input#5,rec$(n):ifrec$(n)=">"thenrec$(n)=" "
1811 nextn:gosub1618:ifet=8then1528
1812 onkgosub1826,1870,1928
1814 ifk=2thengosub1904
1816 nexti
1818 close5:close15
1820 ifk=2then1906
1822 goto1801
1824 rem-nonformatted
1826 print#pf,"[ record #";i;" ]";:forj=1to61:print#pf,"-";:nextj:gosub2888
1828 pl=pl+1:forn=1tof
1830 print#pf,f$(n);:forj=1to20-len(f$(n)):print#pf,".";:nextj
1831 ifrec$(n)=">"thenrec$(n)=" "
1832 print#pf,rec$(n):pl=pl+1:nextn:gosub2888:pl=pl+1
1834 ifpl+f<=60thenreturn
1835 forj=1to65-pl:gosub2888:nextj:pl=0:pg=pg+1:print#pf,"page"pg:return
1836 rem-title
1838 forj=1tonl:iftt$(j)<>">"thengosub1846
1842 nextj:return
1846 b=int((pw-l