home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
log
/
g3zcz15
/
logrenam.2
< prev
next >
Wrap
Text File
|
1985-09-28
|
2KB
|
57 lines
10 REM LOGRENAM VER 790906
20 Q=0
30 ERRSET 9060,E1,E2
40 REM DIRECTORY FILE IS <*> AND MUST BE TYPE 3
50 REM INITIALIZE STRING SPACE
60 DIM A(15),O$(8),N$(8),T$(8)
100 REM GET DATA AND OPEN FILE
110 INPUT "Which disc drive ? ",D\IFD<0ORD>4THEN110
120 D$=STR$(D)
130 INPUT "Name of existing log file? ",O$\IFO$=""THEN130
150 INPUT "New name for file ? ",N$\IFN$=""THEN150
160 IF LEN(N$)<8THEN170ELSE!"LENTH ERROR (max is 7)"\GOTO150
170 N1$=N$
180 IF FILE(O$+","+D$(2,2))=2 THEN 190 ELSE 200
190 PRINT"FILE ",O$," IS A COMMAND ON THIS DISC"\GOTO 130
200 IF FILE(N$+","+D$(2,2))=2 THEN 210 ELSE 220
210 PRINT"FILE ",N$," IS A COMMAND ON THIS DISC"\GOTO 150
220 IF FILE(N$+","+D$(2,2))=3 THEN 230 ELSE 240
230 PRINT"FILE ",N$," ALREADY EXISTS"\GOTO 150
240 OPEN #0,"<*>,"+D$
250 REM START READING THRU DIRECTORY TO FIND OLD FILE
260 FOR I=0 TO 62
270 READ #0%I*16,&A(0),&A(1),&A(2),&A(3),&A(4),&A(5)
280 READ #0,&A(6),&A(7),&A(8),&A(9),&A(10),&A(11)
290 READ #0,&A(12),&A(13),&A(14),&A(15)
300 IF CHR$(A(0))=" " THEN GOTO 340
310 T$=CHR$(A(0))+CHR$(A(1))+CHR$(A(2))+CHR$(A(3))+CHR$(A(4))
320 T$=T$+CHR$(A(5))+CHR$(A(6))+CHR$(A(7))
330 IF O$=T$(1,LEN(O$)) THEN EXIT 370
340 NEXT I
350 IF Q=0 THEN 360 ELSE IF O$(1,1)="*" THEN PRINT"POINTER FILE MISSING"
360 !"FILE ",O$," NOT FOUND"\GOTO 490
370 REM CONVERT NEW FILE NAME TO ASCII
380 J=1\N$=N$+" "
390 FOR K=0 TO 7
400 A(K)=ASC(N$(J,J))
410 J=J+1
420 NEXT K
430 REM NOW WRITE OUT NEW DIRECTORY ENTRY
440 WRITE #0%I*16,&A(0),&A(1),&A(2),&A(3),&A(4),&A(5),NOENDMARK
450 WRITE #0,&A(6),&A(7),&A(8),&A(9),&A(10),&A(11),NOENDMARK
460 WRITE #0,&A(12),&A(13),&A(14),&A(15),NOENDMARK
470 CLOSE #0
480 IF Q=1 THEN 490 ELSE Q=1\O$="*"+O$\N$="*"+N$(1,LEN(N1$))\GOTO 170
490 REM ENDING
9000 FOR I=1 TO 4
9010 IF FILE("SYSTEM,"+STR$(I))=2 THEN EXIT 9030
9020 NEXT \ GOTO 9040
9030 CHAIN "SYSTEM,"+STR$(I)
9040 PRINT"put a system disc in any drive, then hit 'RETURN'"
9050 INPUT" ",A$ \ GOTO 9000
9060 ERRSET 9060,E1,E2
9070 IF E2=15THEN9000
9080 IFE1=9010THENIFI<1ORI>4THEN9040ELSE9020
9090 IFE2<>7THEN9100ELSEPRINT"FILE ERROR"\GOTO9000è9100 IFE2<>8THEN9110ELSEPRINT"HARD DISC ERROR"\GOTO9110
9110 PRINT"ERROR ",E2," AT LINE ",E1\GOTO9000