*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,11,January,1991
 1291DATA 15

 1301DATA WizBlob,...
 1302DATA PAGE=&1900:CH."WizLoad"|M,BCMP,B,ACD
 1303DATA A game

 1311DATA Covers,...
 1312DATA CH."Covers"|M,BCMP,B,ACD
 1313DATA Produce standard cassette inlays for your tapes

 1321DATA Calendar,...
 1322DATA CH."Calendr"|M,BCMP,B,ACD
 1323DATA Produces a complete calendar on screen for any month

 1331DATA Quelle heure est-il?,...
 1332DATA PAGE=&1900:CH."TIMEF"|M,BCMP,B,ACD
 1333DATA Learn to tell the time in French.

 1341DATA Que hora es?,...
 1342DATA PAGE=&1900:CH."TIMES"|M,BCMP,B,ACD
 1343DATA Learn to tell the time in Spanish.

 1351DATA Wieviel Uhr ist es?,...
 1352DATA PAGE=&1900:CH."TIMEG"|M,BCMP,B,ACD
 1353DATA Learn to tell the time in German.

 1361DATA What is the time?,...
 1362DATA PAGE=&1900:CH."TIMEE"|M,BCMP,B,ACD
 1363DATA Learn to tell the time in English.

 1371DATA Routine Matters: KeyTune,...
 1372DATA PAGE=&1900:CH."R.KeyTune"|M,BCMP,B,ACD
 1373DATA Musical key response

 1381DATA Routine Matters: Errors,...
 1382DATA PAGE=&1900:CH."R.Errors"|M,BCMP,B,ACD
 1383DATA Generate your own errors -- deliberately!

 1391DATA Routine Matters: TextChk,...
 1392DATA PAGE=&1900:CH."R.TextChk"|M,BCMP,B,ACD
 1393DATA Sort out your upper and lower case input

 1401DATA Routine Matters: Graph,...
 1402DATA PAGE=&1900:CH."R.Graph"|M,BCMP,B,ACD
 1403DATA Draws a graph

 1411DATA Routine Matters: Anagram,...
 1412DATA PAGE=&1900:CH."R.Anagram"|M,BCMP,B,ACD
 1413DATA Produces anagrams

 1421DATA WW+ Database,...
 1422DATA *|| Load text file 'WrdBase' into WW+ and split up the files manually.|M,BCMP,T,ACD
 1423DATA Load text file 'WrdBase' into WW+ and split up the files manually.


 2310DATA Checksums (new),- 
 2320DATA *xs|M,BCMP,R,AD
 2330DATA The 1989 version which handles DATA statements correctly

 2340DATA Checksums (old),- 
 2350DATA *xsum|M,BCMP,R,AD
 2360DATA The 1988 version with LIST type parameters -- gives wrong checksums for some DATA statements

RUN
