10 ! PROGRAM UPDMAS.BAS
11 ! TO UPDATE ENTRIES IN ACCOUNT MASTER INDEX
20 DIM A$[80]V,B$[80]V,N$[40]V,T1$[3]V(2),R$[80]V
30 N$="MASTER.INF/RN/LN:80/UP"
40 OPEN #3,N$
50 R$="UNASSIGNED/LARRY/FRANK/DAN/DEANA/HARVEY/CLARENCE/HANS"
60 R1=7 : ! DEFINE MAX NUMBER OF PERSONS RESPONSIBLE FOR ACCOUNTS
70 IF END THEN 600
100 INPUT "ACCOUNT TO UPDATE - (NO BRACKETS) ",G,U
110 FOR I=1 TO NRC(3)
120 INPUT LINE #3'I,A$
130 B$=SBS$(A$,2,8)
140 B$=LTR$(TRM$(B$))
150 T1$(1)=PIECE$(B$,",",1)
160 T1$(2)=PIECE$(B$,",",2)
170 G1=VAL(T1$(1)) : U1=VAL(T1$(2))
180 IF G1=G AND U1=U THEN 300
190 NEXT I
200 PRINT "ENTRY NOT FOUND"
210 GOTO 100
300 PRINT "ACCOUNT: ";SBS$(A$,1,9)
310 PRINT "CURRENT RESPONSIBILITY: ";PIECE$(R$,"/",VAL(SBS$(A$,10,2))+1)
320 PRINT "RESPONSIBILITY CHOICES:"
330 FOR J=1 TO R1
340 PRINT " "+STR$(J)+") "+PIECE$(R$,"/",J+1)
350 NEXT J
360 INPUT LINE B$
365 IF LEN(B$)=0 THEN LET J1=VAL(SBS$(A$,10,2))
366 IF LEN(B$)<>0 THEN LET J1=VAL(B$)
370 IF J1<0 OR J1>R1 PRINT "INVALID ANSWER " : GOTO 320
420 B$=RJS$(STR$(J1),2)
430 CALL "INSTRG"(A$,B$,10)
440 GOTO 500
500 PRINT "DESC: ";SEG$(A$,12,80)
510 INPUT LINE "NEW DESC: ",B$
520 IF LEN(B$)=0 THEN 540
530 CALL "INSTRG"(A$,B$,12,69)
540 PRINT #3'I,A$
550 GOTO 100
600 CLOSE
605 IF END THEN 0
610 RUN "MASTER"
