100 INPUT "Which language do you wish to deal with";L$
110 PRINT:PRINT "please wait...";
120 N=1:C1=0:C2=0
130 K$=LEFT$(L$,8)+".DAT"
140 OPEN "R",#1,K$,29
150 FIELD #1,1 AS F$,14 AS E$,14 AS A$
160 GET #1,N:IF F$=CHR$(255) THEN LET N=N+1:GOTO 160
170 PRINT CL$:PRINT "There are ";N-1;" entries in the ";L$;" file.":PRINT
180 IF N=1 THEN GOSUB 580
190 GOTO 420
200 PRINT "Do you wish to give the ENGLISH words for ";L$;" words? (Y/N)";
210 GOSUB 730:PRINT CL$
220 REM Q$=QUESTION, R$=RESPONSE
230 PRINT "If you wish to finish type Q for Quit, or <RETURN> only for Don't Know.":PRINT
240 IF Y=0 THEN PRINT "Give the ENGLISH words for the following ";L$;" words.":PRINT ELSE PRINT "Give the ";L$;" words for the following ENGLISH words.":PRINT
250 GET #1,INT(RND*(N-1)+1)
260 T=0
270 IF Y=0 THEN LET Q$=A$:R$=E$ ELSE LET Q$=E$:R$=A$
280 PRINT Q$;" ";:INPUT; "",AN$
290 IF AN$="Q" THEN 400
300 IF T=0 THEN C1=C1+1
310 IF AN$="" THEN 360
320 FOR S=LEN(AN$)+1 TO 14:AN$=AN$+" ":NEXT S
330 T=T+1
340 IF AN$<>"" AND AN$=R$ THEN PRINT ,"correct":C2=C2+1:GOTO 250
350 IF T<3 THEN PRINT ,"try again":GOTO 280
360 PRINT:PRINT "The correct answer is: ";R$
370 PRINT "Hit any key to continue or Q to quit.";
380 U$=INKEY$:IF U$="" THEN 380
390 IF U$="Q" THEN 400 ELSE PRINT:PRINT:GOTO 250
400 PRINT CL$:REM QUIT OPTIONS
410 PRINT "You have scored";C2;"correct answers out of";C1;"tries.";:IF C1=0 THEN PRINT:PRINT:GOTO 420 ELSE PRINT " (";INT(100*C2/C1);"% )":PRINT:PRINT
420 PRINT "Select one of the following:":PRINT:PRINT
430 PRINT " 1. ";L$;" drill":PRINT
440 PRINT " 2. Add entries":PRINT
450 PRINT " 3. List entries":PRINT
460 PRINT " 4. Correct an entry":PRINT
470 PRINT " 5. Start again (another language)":PRINT
480 PRINT
490 PRINT " 0. Quit programme":PRINT:PRINT
500 PRINT " 0/1/2/3/4/5?";
510 X$=INKEY$:IF X$="" OR (X$<>"0" AND X$<>"1" AND X$<>"2" AND X$<>"3" AND X$<>"4" AND X$<>"5") THEN 510
520 X=VAL(X$):IF X<0 OR X>5 THEN 510
530 PRINT CL$
540 IF X=0 THEN CLOSE #1:SYSTEM
550 ON X GOSUB 1200,580,800,980,780
560 IF X=1 THEN GOTO 200
570 PRINT CL$:GOTO 420
580 REM Enter new words
590 PRINT "Type Q to quit.":PRINT
600 PRINT "The maximun length for any word is 14 characters.":PRINT:PRINT:PRINT
610 LSET F$=CHR$(255)
620 PRINT L$;:INPUT " word: ",V$
630 IF V$="Q" THEN PRINT CL$:RETURN
640 LSET A$=V$
650 INPUT "ENGLISH word: ",W$
660 IF W$="Q" THEN PRINT CL$:RETURN
670 LSET E$=W$
680 PRINT
690 PUT #1,N
700 IF P=1 THEN RETURN
710 N=N+1
720 GOTO 610
730 REM (Y/N), "Y":Y=0, "N":Y=1
740 Y$=INKEY$:RA=RND:IF Y$="" THEN 740
750 IF Y$<>"N" AND Y$<>"Y" THEN 740
760 IF Y$="Y" OR Y$="y" THEN LET Y=0:RETURN
770 Y=1:RETURN
780 REM START AGAIN
790 CLOSE #1:PRINT CL$:GOTO 100
800 REM LIST ENTRIES
810 PRINT CL$
820 PRINT "Press <SPACE> to stop and start listing.":PRINT
830 INPUT "At which number do you wish to start the listing";N1
840 IF N1>=N THEN PRINT "Number may not be larger than";N-1:GOTO 830
850 FOR B=N1 TO N-1
860 GET #1,B
870 PRINT B,A$;" ";E$
880 U$=INKEY$:IF U$<>" " THEN 930
890 PRINT "<SPACE> to continue, Q to quit.";
900 U$=INKEY$:IF U$<>" " AND U$<>"Q" THEN 900
910 PRINT
920 IF U$="Q" THEN RETURN
930 NEXT B
940 IF P=1 THEN RETURN
950 PRINT:PRINT "Press any key to continue."
960 K$=INKEY$:IF K$="" THEN 960
970 RETURN
980 REM CORRECT AN ENTRY
990 PRINT:PRINT "Use L option to list words so that you know the reference number.":PRINT
1000 PRINT "Use Q to Quit.":PRINT
1010 INPUT "Enter refernce number/L/Q:",Z$
1020 IF Z$="Q" THEN RETURN
1030 IF Z$="L" THEN LET P=1:GOSUB 800:P=0:PRINT:PRINT:GOTO 1010
1040 REF=VAL(Z$)
1050 IF REF>N-1 THEN PRINT "Number may not be larger than";N-1:PRINT:GOTO 980
1060 PRINT:PRINT "Is this the entry you wish to change?"