home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 3
/
FreeSoftwareCollection3pd199x-jp.img
/
oh_fm
/
townsfos
/
list.bas
< prev
next >
Wrap
BASIC Source File
|
1980-01-02
|
2KB
|
62 lines
10000 '
10010 ' List : File Listing Ulitity
10020 '
10030 ' Filename "LIST.BAS"
10040 '
10050 ' Last Update 1989. 5.19 Ver.1.01
10060 '
10070 '
10080 DEFINT A-Z
10090 NFLG=0
10100 PFLG=0
10110 LN=1
10120 '
10130 IF ARGC>1 THEN *PARA
10140 PRINT:PRINT "***** List : File Listing Utility : Ver.1.01 *****"
10150 PRINT
10160 LINE INPUT " Filename ? ",FL$
10170 IF FL$="" THEN *END_EXIT
10180 GOTO *MAIN
10190 '
10200 *PARA
10210 FOR I=1 TO ARGC-1 : A$=ARGV$(I)
10220 IF A$="?" THEN *HELP
10230 IF A$="-p" OR A$="-P" THEN PFLG=-1:GOTO *SK_1
10240 IF A$="-n" OR A$="-N" THEN NFLG=-1:GOTO *SK_1
10250 IF FL$="" THEN FL$=A$:GOTO *SK_1
10260 GOTO *PARA_ERR
10270 *SK_1
10280 NEXT
10290 GOTO *MAIN
10300 '
10310 *HELP
10320 S_A$="\n***** Help Message for List : Ver.1.01 *****\n\n": GOSUB *S_PUTS_E
10330 S_A$=" List : File Listing Utility\n":GOSUB *S_PUTS_E
10340 S_A$=" Usage : List Filename [-p] [-n]\n":GOSUB *S_PUTS_E
10350 S_A$=" Option : -p Printer\n":GOSUB *S_PUTS_E
10360 S_A$=" : -n Line Number\n":GOSUB *S_PUTS_E
10370 GOTO *END_EXIT
10380 '
10390 *PARA_ERR
10400 S_A$="@ Parameter Error!\n":GOSUB *S_PUTS_E
10410 '
10420 *END_EXIT
10430 IF ARGC=0 THEN END
10440 RETURN *S_T_RETURN
10450 '
10460 ' MAIN
10470 '
10480 *MAIN
10490 IF PFLG THEN OPEN "O",#1,"LPT0:" ELSE OPEN "O",#1,"SCRN:"
10500 OPEN "I",#2,FL$
10510 '
10520 *LOOP
10530 LINE INPUT #2,A$
10540 IF NFLG THEN A$=RIGHT$("0000"+MID$(STR$(LN),2),5)+":"+A$:LN=LN+1
10550 PRINT #1,A$
10560 IF EOF(2) THEN *LOOP_EXIT
10570 GOTO *LOOP
10580 *LOOP_EXIT
10590 CLOSE
10600 GOTO *END_EXIT