File Archive

 
Output of file : CONVPHON.BAS contained in archive : FSTRM311.ZIP

5 CLS
10 PRINT " 1. FSEDIAL.DIR TO ASCII FORMAT"
20 PRINT " 2. ASCII FSEDIAL.TXT TO FSEDIAL.DIR FORMAT"
30 PRINT " 3. CONVERT BBS LIST TO FSEDIAL.TXT ASCII FORMAT"
35 PRINT " 4. END PROGRAM
40 PRINT
50 INPUT " ENTER OPTION: ",OPT
60 IF OPT=1 THEN GOTO 1000
70 IF OPT=2 THEN GOTO 2000
80 IF OPT=3 THEN GOTO 3000
90 IF OPT=4 THEN CLOSE:SYSTEM
1000 PRINT
1010 INPUT "ENTER FILENAME FOR ASCII FILE: ",FILENAME$
1020 OPEN FILENAME$ FOR OUTPUT AS #3
1030 OPEN "FSEDIAL.DIR" AS #2 LEN=72
1035 FIELD #2, 72 AS PHONREC$:PRINT " PROCESSING..."
1040 WHILE NOT EOF(2)
1050 GET #2
1060 PRINT #3,PHONREC$
1070 CTR=CTR+1
1080 WEND
1090 PRINT
1100 PRINT "PROGRAM COMPLETED ";CTR;" RECORDS CONVERTED TO ";FILENAME$
1110 CLOSE
1120 SYSTEM
2000 PRINT
2010 INPUT "ENTER FILENAME TO CONVERT: ",FILENAME$
2020 OPEN FILENAME$ FOR INPUT AS #2
2024 ON ERROR GOTO 2029
2025 OPEN "FSEDIAL.DIR" FOR INPUT AS #3
2026 CLOSE #3:BEEP:INPUT "FSEDIAL.DIR ALREADY EXISTS! OVERWRITE? (Y/N) ",ANS$
2027 IF ANS$="Y" OR ANS$="y" THEN GOTO 2030
2028 CLOSE:SYSTEM
2029 RESUME 2030
2030 CLOSE #3:PRINT " PROCESSING..."
2035 OPEN "FSEDIAL.DIR" AS #3 LEN=72
2040 FIELD #3, 72 AS RECOUT$
2050 WHILE NOT EOF(2)
2060 LINE INPUT #2,REC$
2070 LSET RECOUT$ = REC$
2080 CTR=CTR+1
2090 PUT #3
2100 WEND
2110 PRINT "PROGRAM COMPLETED ";CTR;" RECORDS CONVERTED TO RANDOM FILE"
2115 PRINT "FSEDIAL.DIR CREATED"
2120 CLOSE
2130 SYSTEM
3000 PRINT
3010 PRINT " CREATE ASCII PHONE BOOK FROM BBS LIST"
3020 PRINT:INPUT "Enter name of BBS file to convert: ",CONVERT$
3030 PRINT:INPUT "Enter starting position of phone number: ",PST
3040 PRINT:INPUT "Enter ending position of phone number: ",EPST
3045 PRINT:INPUT "Enter the dialing prefix (if any): ",PREFIX$
3050 PRINT:INPUT "Enter starting position of name: ",SNAME
3060 PRINT:INPUT "Enter ending position of name: ",ENAME
3062 PRINT:INPUT "Enter the default baud rate: ",BAUD$
3063 BAUD$=BAUD$+STRING$(6-LEN(BAUD$)," ")
3064 PRINT:INPUT "Enter default data bits (7 or 8): ",DTA$
3065 IF DTA$="8" THEN PARITY$="N":GOTO 3067
3066 PRINT:INPUT "Enter the default parity in CAPS (E O N): ",PARITY$
3067 PRINT:INPUT "Host computer Echoing characters? Enter Default in CAPS (Y or N): ",ECHO$
3068 PRINT:INPUT "Enter the default stop bits (1 or 2): ",STPBITS$
3070 NALEN=(ENAME-SNAME)+1:IF NALEN>23 THEN NALEN=23
3075 NUMLEN=(EPST-PST)+1:IF NUMLEN>19 THEN NUMLEN=19
3080 ON ERROR GOTO 3240
3090 OPEN CONVERT$ FOR INPUT AS #2
3100 OPEN "FSEDIAL.TXT" FOR OUTPUT AS #3
3110 PRINT:PRINT " PROCESSING...."
3115 NUMBLEN=NUMLEN+LEN(PREFIX$):IF NUMBLEN>19 THEN NUMBLEN=19
3120 WHILE NOT EOF(2)
3130 LINE INPUT #2,REC$
3150 NUMBER$=MID$(REC$,PST,NUMLEN)
3157 NME$=MID$(REC$,SNAME,NALEN)
3160 REC$=PREFIX$+NUMBER$+STRING$(19-NUMBLEN," ")+STRING$(10," ")+NME$+STRING$(23-LEN(NME$)," ")
3165 REC$=REC$+STRING$(7," ")+BAUD$+DTA$+" "+PARITY$+" "+STPBITS$+" "+ECHO$
3170 PRINT #3,REC$
3180 CTR=CTR+1
3190 WEND
3200 PRINT
3210 PRINT "COMPLETE, ";CTR;" RECORDS PROCESSED":BEEP:PRINT
3215 PRINT
3220 PRINT "FILE SAVED AS FSEDIAL.TXT (ASCII FORMAT). USE OPTION 2 TO CONVERT TO"
3224 PRINT "FSEDIAL.DIR FOR USE IN PROGRAM."
3225 CLOSE
3230 SYSTEM
3240 'STOPIT
3250 BEEP:PRINT:PRINT " ERROR WITH FILES!!"
3255 CLOSE
3260 SYSTEM