home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 3
/
FREEWARE.BIN
/
oh_fm
/
townsfos
/
del.bas
< prev
next >
Wrap
BASIC Source File
|
1980-01-02
|
1KB
|
52 lines
10000 '
10010 ' Del : Delete a file
10020 '
10030 ' Filename "DEL.BAS"
10040 '
10050 ' Last Update 1989. 5.20 Version 1.01
10060 '
10070 '
10080 DEFINT A-Z
10090 RFLG=0
10100 FL$=""
10110 '
10120 IF ARGC>1 THEN *PARA
10130 PRINT : PRINT "***** Del : Delete a File : Ver.1.01 *****"
10140 PRINT
10150 LINE INPUT " Filename ? ",FL$ : IF FL$="" THEN *END_EXIT
10160 GOTO *MAIN
10170 '
10180 *PARA
10190 FOR I=1 TO ARGC-1 : A$=ARGV$(I)
10200 IF A$="?" THEN *HELP
10210 IF A$="-r" OR A$="-R" THEN RFLG=-1:GOTO *PA_1
10220 IF FL$="" THEN FL$=A$:GOTO *PA_1
10230 GOTO *PARA_ERR
10240 *PA_1:NEXT
10250 GOTO *MAIN
10260 '
10270 *HELP
10280 S_A$="\n***** Help Message for Del *****\n\n":GOSUB *S_PUTS_E
10290 S_A$=" Del : Delete a file\n":GOSUB *S_PUTS_E
10300 S_A$=" Usage : Del <filename> [-r]\n":GOSUB *S_PUTS_E
10310 S_A$=" -r : Ready\n":GOSUB *S_PUTS_E
10320 GOTO *END_EXIT
10330 '
10340 *PARA_ERR
10350 S_A$="@ Parameter Error!\n":GOSUB *S_PUTS_E
10360 '
10370 *END_EXIT
10380 IF ARGC=0 THEN END
10390 RETURN *S_T_RETURN
10400 '
10410 ' MAIN
10420 '
10430 *MAIN
10440 OPEN "I",#1,FL$ : CLOSE
10450 IF RFLG THEN *DEL_2
10460 *DEL_1:INPUT " Are You Sure (y/n) ? ",A$
10470 IF A$="" OR A$="n" OR A$="N" THEN *END_EXIT
10480 IF A$<>"y" AND A$<>"Y" THEN *DEL_1
10490 *DEL_2:KILL FL$
10500 GOTO *END_EXIT