*BASIC
   10REM Menu Data Creator
   20REM by Steve Turnbull
   30REM (c) Database Publications
   40PROCinit
   50PROCreaddata
   60PROCassm
   70OSCLI("SAVE FDATA "+STR$~data+"+"+STR$~Q%+" 0 0")
   80END
   90DEF PROCinit
  100DIM data &C00
  110base=&2000
  120FORI%=data TOdata+&C00-1STEP4
  130!I%=0:NEXT
  140files$="ACDT"
  150types$="BDELRS"
  160mchns$="ABCMPZ"
  170ENDPROC
  180DEF PROCreaddata
  190READ v$,n$,m$,y$,noof
  200DIM n$(noof),p$(noof),f$(noof)
  210DIM m$(noof),t$(noof),s$(noof)
  220DIM h$(noof)
  230FOR F%=0 TO noof-1
  240READ n$(F%),p$(F%),f$(F%)
  250READ m$(F%),t$(F%),s$(F%),h$(F%)
  260NEXT:ENDPROC
  270File structure:
  280Number of files      --  1 byte
  290Offset to Volume     --  2 bytes
  300Offset to Issue      --  2 bytes
  310Offset to Date       --  2 bytes
  320Offset of type table --  2 bytes
  330Offset of mach table --  2 bytes
  340Offset of FS table   --  2 bytes
  350Offset of name offs  --  2 bytes
  360Offset of page offs  --  2 bytes
  370Offset of fnam offs  --  2 bytes
  380Offset of help offs  --  2 bytes
  390Type table           --  n bytes
  400Machines table       --  n bytes
  410FS table             --  n bytes
  420Offsets to name      -- 2n bytes
  430Offsets to page      -- 2n bytes
  440Offsets to filename  -- 2n bytes
  450Offsets to help      -- 2n bytes
  460Start of strings     -- 21+11n bytes
  470DEF PROCassm
  480O%=0:R%=21:Q%=R%+11*noof
  490PROCb(noof)
  500PROCw(Q%):PROCx(784,988,"Volume"+FNf(v$,3))
  510PROCw(Q%):PROCx(784,946,"Issue"+FNf(n$,3))
  520PROCw(Q%):PROCx(784,902,m$+" "+y$)
  530PROCw(R%):R%=R%+noof
  540PROCw(R%):R%=R%+noof
  550PROCw(R%):R%=R%+noof
  560PROCw(R%):R%=R%+2*noof
  570PROCw(R%):R%=R%+2*noof
  580PROCw(R%):R%=R%+2*noof
  590PROCw(R%):R%=R%+2*noof
  600FOR F%=0 TO noof-1
  610PROCbyte(t$(F%),types$):NEXT
  620FOR F%=0 TO noof-1
  630PROCbyte(m$(F%),mchns$):NEXT
  640FOR F%=0 TO noof-1
  650PROCbyte(s$(F%),files$):NEXT
  660FOR F%=0 TO noof-1
  670PROCw(Q%):PROCstr(n$(F%)):NEXT
  680FOR F%=0 TO noof-1:PROCw(Q%)
  690PROCstr(FNf(p$(F%),3)):NEXT
  700FOR F%=0 TO noof-1:PROCw(Q%)
  710PROCstr("*K.10 "+f$(F%)):NEXT
  720FOR F%=0 TO noof-1:PROCw(Q%)
  730PROCstr(FNj(h$(F%),33)+CHR$0):NEXT
  740ENDPROC
  750DEF FNj(t$,W%)
  760LOCAL l$,s$,w$:t$=t$+" "
  770REPEAT w$=FNwd
  780IF LENw$+LENl$>=W% s$=s$+l$+CHR$10+CHR$13:l$=w$ ELSE l$=l$+" "+w$
  790UNTIL t$="":=MID$(s$+l$,2)
  800DEF FNwd:LOCAL C%,w$:IF t$="" =""
  810C%=INSTR(t$," "):w$=LEFT$(t$,C%-1)
  820t$=MID$(t$,C%+1):=w$
  830DEF PROCb(B%)
  840data?O%=B%:O%=O%+1:ENDPROC
  850DEF PROCw(W%)
  860W%=W%+base:PROCb(W%MOD256)
  870PROCb(W%DIV256):ENDPROC
  880DEF FNf(x$,L%)=RIGHT$(STRING$(L%," ")+x$,L%)
  890DEF PROCx(X%,Y%,t$)
  900PROCwq(X%):PROCwq(Y%)
  910PROCstr(t$+CHR$13):ENDPROC
  920DEF PROCwq(W%):PROCbq(W%MOD256)
  930PROCbq(W%DIV256):ENDPROC
  940DEF PROCbq(B%)
  950data?Q%=B%:Q%=Q%+1:ENDPROC
  960DEF PROCstr(x$):$(data+Q%)=x$
  970Q%=Q%+LENx$+1:ENDPROC
  980DEF PROCbyte(x$,k$)
  990LOCAL B%,L%,P%,Z%:B%=1
 1000L%=LENk$:IF L%>8 ERROR
 1010FOR P%=1 TO L%
 1020Z%=Z%OR((INSTR(x$,MID$(k$,P%,1))>0)ANDB%)
 1030B%=B%+B%:NEXT
 1040PROCb(Z%):ENDPROC
 1050Issue:    Volume, Issue, Month, Year
 1060Files:    Number of
 1070Name:     Text string <30 characters
 1080Page:     Page number (string)
 1090Run:      String
 1100Machine:  A = Archimedes
 1110          B = BBC B
 1120          C = Compact
 1130          M = Master
 1140          P = B+
 1150          Z = Z88
 1160Type:     B = Basic
 1170          D = Data
 1180          E = *EXECable file
 1190          L = *LOADable file
 1200          R = *RUNable file
 1210          S = *SRLOADable file
 1220          T = Text
 1230FS:       A = ADFS
 1240          C = CFS
 1250          D = DFS
 1260          T = Teletext
 1270          I = IEEE
 1280Help:     Help text
 1290DATA 8,6,August,1990
 1300DATA 8

 1301DATA Lunar Eclipse,43
 1302DATA CH."Eclipse"|M,ABCMP,B,ADT
 1303DATA Pretty nifty little prog for all sky watchers.

 1310DATA RAM Board Tester,99
 1311DATA CH."RamTest"|M,BMP,B,ADT
 1312DATA Program to provide a thorough test of the RAM on the expansion board.

 1320DATA RAM Board Firmware,99
 1321DATA *SRLOAD "Firmwre" 8000 7 Q|M,BMP,S,ADT
 1322DATA The RamDisc software for the expansion board - pretty hot stuff.

 1330DATA TX81Z Programmer,64
 1331DATA *|| TXProg must be loaded into a Hybrid Music System|M,BMP,T,AD
 1332DATA Program your TX81Z MIDI Expander using the Music 2000 interface.

 1340DATA Ultima (again),- 
 1341DATA CH."Ultima"|M,BCMP,D,ADT
 1342DATA Last months was in error - sorry

 1350DATA Press COPY,!!
 1351DATA *EXEC!BOOT|M,BCMP,D,ADT
 1352DATA "Sorry, not much on the disc this month. I'll make it up to you, Love Teri."

 2610DATA Checksums (new),- 
 2620DATA *xs|M,BCMP,R,AD
 2630DATA The 1989 version which handles DATA statements correctly

 2640DATA Checksums (old),- 
 2650DATA *xsum|M,BCMP,R,AD
 2660DATA The 1988 version that will checksum ranges of lines and print too.
