rem user file maintenance program dim vfn$(250),vln$(250),vct$(250),vac$(250),vdt$(250),vtm$(250) dim vpw$(250),vcn$(250),vrs$(250),vdl$(250) %nolist hdr$="### First Last Location ACL Date Time CLS STAT EQ" def pdat$(x$)=mid$(x$,3,2)+"/"+right$(x$,2)+"/"+left$(x$,2) rem make MM/DD/YY def ptim$(x$)=left$(x$,2)+":"+mid$(x$,3,2)+":"+right$(x$,2) rem make HH:MM:SS def fill$(x$,n%) integer i for i=1 to n% x$=x$+" " next i fill$=left$(x$,n%) fend def header(x$) print chr$(27);"E" print x$ print : print : print fend dim eq$(9),os$(7) eq$(1)="KAYPRO" eq$(2)="OSBORNE" eq$(3)="NORTH STAR" eq$(4)="XEROX" eq$(5)="IBM" eq$(6)="IBM CLONE" eq$(7)="TANDY" eq$(8)="S-100" eq$(9)="OTHER" os$(1)="CP/M 2.2" os$(2)="CP/M Plus" os$(3)="MP/M" os$(4)="MSDOS" os$(5)="TurboDOS" os$(6)="xxNIX" os$(7)="other" os$(8)="CP/M-86" print "[RTDS (c) 1984 ESKAY]" print "[MAINT v2.00]" print "[";pdat$(date$);" - ";ptim$(time$);"]" print dim ac$(9) ac$(0) = "NEW CALLER" ac$(1) = "RESTRICTED" ac$(3) = "FULL USER" ac$(4) = ac$(3) ac$(5) = ac$(3) ac$(9) = "SYSOP" ufile$="USER"+CHR$(ASC("S")+128)+".SYS" open ufile$ recl 128 as 1 loop: print : print : print : print print "Select one:" : print print " a = Add a new user" print " b = Browse through file" print " d = Delete a user" print " e = Edit user data" print " l = List (by access level)" print " q = Query (search for user)" print " s = Sort file by # of calls" print print " x = eXit to TurboDOS" print input "Your Choice Please "; line sel$ sel$=ucase$(sel$)+" " jmp=match(left$(sel$,1),"ADELQXSB",1) if jmp=0 then print : goto loop on jmp goto add,delt,edit,lst,search,quit,sort,browse rem rem add a new user rem add: call header("[add new user]") print "CR returns to menu..." input "Enter user's FIRST NAME > ";line nfn$ input " LAST NAME > ";line nln$ if nfn$="" or nln$="" then goto loop nfn$=ucase$(nfn$) : nln$=ucase$(nln$) add.lp: for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if udl$="*" then goto add.f.sp next i% print : print print "SORRY, NO MORE ROOM IN FILE!" print : goto loop add.f.sp: print "Found room for ";nfn$;" ";nln$;" at record # ";i% print "Please enter now:" input " location "; line nct$ : nct$=ucase$(nct$) input " password (or CR) "; line npw$ if npw$="" then npw$=" " input " access level 0..9 "; line nac$ print print #1, i%; nfn$,nln$,nct$,nac$,"000000","000000",npw$,"0","res"," " goto add search: call header("[search for name]") print "Enter LAST name (partial name may match more)" input "or press CR to return to menu > ";line sln$ if sln$="" then goto loop print : print sln$=ucase$(sln$) for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if match(sln$,uln$,1) = 1 then gosub prt.dta :\ input "hit CR to continue"; line xx$ next i% goto search delt: call header("[delete user entry]") input "Enter LAST NAME or CR to quit > "; line dln$ if dln$="" then goto loop dln$=ucase$(dln$) yn$="" for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if (uln$<>dln$) or (udl$<>" ") then goto no.dlt gosub prt.dta input ">>>>>>>>>>>> DELETE THIS ENTRY ? "; line yn$ yn$=ucase$(yn$)+"N" if left$(yn$,1)="Y" then udl$="*" : gosub wrt.dta : goto delt input " Continue search ? "; line yn$ yn$=ucase$(yn$)+"N" if left$(yn$,1)="N" then goto delt no.dlt: next i% if yn$="" then print ">>>>>> NO MATCH FOUND" goto delt wrt.dta: print #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ return edit: call header("[edit record]") input "Enter LAST NAME or CR to exit > "; line eln$ if eln$="" then goto loop eln$=ucase$(eln$) yn$="" for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if uln$<>eln$ then goto no.ed gosub prt.dta input "Edit this entry (n=search for next) "; line yn$ if left$(ucase$(yn$)+"N",1)="N" then goto no.ed print "Hit CR to keep data, else enter new" print "FIRST NAME : ";ufn$;tab(40);"> "; input line nfn$ : if nfn$<>"" then ufn$=ucase$(nfn$) print "LAST NAME : ";uln$;tab(40);"> "; input line nln$ : if nln$<>"" then uln$=ucase$(nln$) print "LOCATION : ";uct$;tab(40);"> "; input line nct$ : if nct$<>"" then uct$=ucase$(nct$) print "PASSWORD : ";upw$;tab(40);"> "; input line npw$ : if npw$<>"" then upw$=ucase$(npw$) print "ACCESS LEVEL : ";uac$;tab(40);"> "; input line nac$ : if nac$<>"" then uac$=ucase$(nac$) print "STATUS (ADT) :";udl$;tab(40);"> "; input line ndl$ : ndl$=ucase$(ndl$) if ndl$="A" then ndl$=" " if ndl$="D" then ndl$="*" if ndl$="T" then ndl$="-" if ndl$<>"" then udl$=ndl$ gosub wrt.dta goto edit no.ed: next i% if yn$="" then print ">>>>> NO MATCH FOUND" goto edit lst: call header("[list by acl]") input "Enter ACL (0..9, or ?=all [any other=menu]) "; line mac$ if match(mac$,"0123456789?",1) = 0 then goto loop prt%=0 input "List to

rinter or rt ? "; line yn$ if left$(ucase$(yn$)+"C",1) = "P" then prt%=-1 : lprinter input "list deleted entries, too ? "; line yn$ if left$(ucase$(yn$)+"N",1) = "Y" then dl%=0 else dl%=-1 ln%=1 : nn%=0 :nnd%=0 for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if ((uac$=mac$) or (mac$="?")) and (left$(ufn$,1)<>" ")\ then if ((dl% and udl$<>"*") or not dl%)\ then gosub dsply : nn%=nn%+1 : if udl$="*"\ then nnd%=nnd%+1 next i% print "TOTAL ENTRIES DISPLAYED :";nn%;" (";nn%-nnd%;"active)." if prt% then print chr$(12) if not prt% then input "Hit CR to continue"; line xx$ console goto loop dsply: if (ln%=1 and prt%) or nn%=0 then print hdr$ ln%=ln%+1 : if (ln%=23) and not prt% then\ ln%=1 : input ">>>>>> Press CR to continue"; line xx$ :\ print hdr$ x$=right$(" "+str$(i%),3)+" " x$=x$+fill$(ufn$,12)+" "+fill$(uln$,12)+" "+fill$(uct$,12)+" " x$=x$+fill$(uac$,4)+pdat$(udt$)+"|"+ptim$(utm$)+" "+fill$(ucn$,5) if udl$=" " then x$=x$+"ACT " if udl$="-" then x$=x$+"TWIT" if udl$="*" then x$=x$+"DEL " x$=x$+" "+urs$ print x$ return browse: call header("[browse]") for i%=1 to 250 read #1, i%; ufn$,uln$,uct$,uac$,udt$,utm$,upw$,ucn$,urs$,udl$ if ufn$=" " then goto brows.c gosub prt.dta print bro.w: input "(un-)Delete, Quit, Continue (D,Q,=C) ? ";line x$ x$=left$(ucase$(x$)+"C",1) if x$="C" then goto brows.c if x$="Q" then goto loop if x$="-" and i%>1 then i%=i%-2 : goto brows.c if x$<>"D" then goto bro.w if udl$="*" then udl$=" " else udl$="*" gosub wrt.dta : print "DELETED***" brows.c: next i% print : print "DONE" : goto loop prt.dta: call header("[caller data]") print "First Name : ";ufn$ print "Last Name : ";uln$ print "Location : ";uct$ print "Access level : ";uac$;" (";ac$(val(uac$));")" print "Last Called... DATE : ";pdat$(udt$) print " TIME : ";ptim$(utm$) print "Password : ";upw$ print "Number of calls : ";ucn$ print "Equipment : ";eq$(val(left$(urs$,1))) print "Operating System : ";os$(val(right$(urs$,1))) print "Entry Status : "; if udl$=" " then print "ACTIVE" if udl$="*" then print "DELETED" if udl$="-" then print "TWIT" print "File pointer number : ";i% return rem rem primitive sort for the user file (done on-disk) rem sort: call header("[sort file]") sort.rd: for i%=1 to 250 read #1, i%; vfn$(i%),vln$(i%),vct$(i%),vac$(i%),vdt$(i%),vtm$(i%),vpw$(i%),vcn$(i%),vrs$(i%),vdl$(i%) if vdl$(i%) = "*" then gosub clr.clr next i% n%=0 sort.loop: n%=n%+1 switch%=0 for i%=1 to 250-n% if val(vcn$(i%))>val(vcn$(i%+1)) then goto no.switch if (val(vcn$(i%))=val(vcn$(i%+1))) and\ (left$(vln$(i%),3)>=left$(vln$(i%+1),3)) then goto no.switch switch%=1 ufn$=vfn$(i%) : uln$=vln$(i%) : uct$=vct$(i%) : uac$=vac$(i%) udt$=vdt$(i%) : utm$=vtm$(i%) : upw$=vpw$(i%) : ucn$=vcn$(i%) urs$=vrs$(i%) : udl$=vdl$(i%) vfn$(i%)=vfn$(i%+1) : vln$(i%)=vln$(i%+1) : vct$(i%)=vct$(i%+1) vac$(i%)=vac$(i%+1) : vdt$(i%)=vdt$(i%+1) : vtm$(i%)=vtm$(i%+1) vpw$(i%)=vpw$(i%+1) : vcn$(i%)=vcn$(i%+1) vrs$(i%)=vrs$(i%+1) : vdl$(i%)=vdl$(i%+1) vfn$(i%+1)=ufn$ : vln$(i%+1)=uln$ : vct$(i%+1)=uct$ vac$(i%+1)=uac$ : vdt$(i%+1)=udt$ : vtm$(i%+1)=utm$ vpw$(i%+1)=upw$ : vcn$(i%+1)=ucn$ vrs$(i%+1)=urs$ : vdl$(i%+1)=udl$ no.switch: next i% print n%;chr$(13); if switch% then goto sort.loop for i%=1 to 250 print #1, i%; vfn$(i%),vln$(i%),vct$(i%),vac$(i%),vdt$(i%),vtm$(i%),vpw$(i%),vcn$(i%),vrs$(i%),vdl$(i%) next i% print : print "SORT COMPLETED" goto loop clr.clr: vfn$(i%) = " " vln$(i%) = " " vct$(i%) = " " vac$(i%) = "0" vdt$(i%) = " " vtm$(i%) = " " vpw$(i%) = " " vcn$(i%) = "0" vrs$(i%) = "res" vdl$(i%) = "*" return quit: close 1 stop end