5 CLOSE:ON ERROR GOTO 3000
10 REM *** DATA DISK INITIATER ***
15 CL$=CHR$(26):F1=1 
20 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
30 PRINT "Insert a blank, CP/M formatted disk to be"
40 PRINT "set up as a Desk Master data disk."
50 PRINT
60 PRINT "WARNING:  The current contents of the"
70 PRINT "inserted disk will be lost."
80 PRINT:PRINT:PRINT
90 GOSUB 2500:RESET: REM Pause
99 REM ***************************************
100 REM
170 REM *** SET UP INDEX FILES ***
175 REM Label disk for data
180 OPEN "O",#F1,"IDENT-DM"  
190 PRINT #F1,"DATA"
200 CLOSE #F1
250 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
260 PRINT SPC(6);"Writing file indexes..."
300 OPEN "O",#F1,"MEMINDEX":GOSUB 700:CLOSE #F1
310 OPEN "O",#F1,"CDXINDEX":GOSUB 700:CLOSE #F1
320 OPEN "O",#F1,"APTINDEX":GOSUB 700:CLOSE #F1
330 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
399 REM ***************************************
400 REM *** RETURN TO MAIN PROGRAM ***
410 PRINT "Insert the Desk Master program disk again..."
420 GOSUB 2500:REM PAUSE
430 DE$="PROGRAM":GOSUB 2570:REM CHECK DISK ID
550 PRINT CL$:FOR N=1 TO 11:PRINT:NEXT
570 PRINT SPC(12);"Reloading Desk Master"
580 CHAIN "DESK-DM.BAS"
599 END:REM *************************************
600 REM
700 REM *** WRITE INDEXES ***
710 PRINT #F1,"0L"
720 FOR F=1 TO 39:PRINT #F1,"0N":NEXT
730 RETURN
740 REM *****************************************
2500 REM *** PAUSE FOR RESPONSE ***
2510 PRINT:PRINT:PRINT
2520 PRINT "Hit any key to continue...";
2530 K$=INPUT$(1)
2540 RETURN
2550 REM ***********************************
2570 REM *** CHECK DISK ID ***
2580 DK$="NOID"
2590 OPEN "I",#F1,"IDENT-DM"
2600 INPUT #F1,DK$
2610 CLOSE #F1
2620 IF DK$="DATA" AND DE$="DATA" THEN GOTO 2670
2630 IF DK$="PROGRAM" AND DE$="PROGRAM" THEN GOTO 2670
2640 PRINT CL$:FOR N=1 TO 7:PRINT:NEXT
2645 PRINT "Insert the Desk Master ";DE$;" disk."
2650 GOSUB 2500:RESET:REM PAUSE
2660 GOTO 2590:REM Until proper disk in drive
2670 RETURN
2999 REM *************************************
3000 REM *** ERROR ROUTINE ***
3010 PRINT CL$:FOR N=1 TO 10:PRINT:NEXT
3020 IF ERR=53 THEN PRINT "File not found: "
3030 IF ERR=57 THEN PRINT "Disk problem:"
3040 IF ERR=61 THEN PRINT "Disk full:"
3050 PRINT:PRINT
3060 PRINT "Make sure you want to use the inserted disk"
3070 PRINT "for Desk Master data, then FORMAT it again"
3080 PRINT "for CP/M and re-initiate it.  Otherwise, try"
3090 PRINT "another blank disk."
3100 IF ERR<>53 AND ERR<>57 AND ERR<>61 THEN GOTO 4000
3110 PRINT:PRINT:PRINT
3120 PRINT "Hit any key to return to main menu..."
3130 K$=INPUT$(1):RESUME 400
4000 ON ERROR GOTO 0
110 PRINT:PRINT:PRINT
3120 PRINT "Hit any key to return 