home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
MISC
/
DESIRE15.ZIP
/
INSTALL.DAT
/
INFO.ZIP
/
XRD-DEV1.ZIP
/
XRD-NAV.ZIP
/
NAV.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-03-29
|
6KB
|
199 lines
Program NewuserAppViewer;
Uses Deskit,Files,DesStr;
Var Username,Input,Temp_Str:String;
{ input strings Temp_Str and Input
{ output string Username as @MCI1@ in NAVFND.PCB }
EndSubLoop,EndLoop:Boolean;
{ variables to end loops lile WHILE/DO and
REPEAT/UNTIL }
SearchNode:Byte; { which ANSWERx.TXT file are we reading ? }
Found:Boolean; { we just found a user }
F:Text; { for textfiles }
i:integer; { aid counter }
C:Byte; { to read a byte from the user }
AidMCI:MCIRPTR; { for the @MCIx@-codes }
ShowCont:Boolean;
EverFound, { did we ever find a user ? }
JustShown:Boolean; { did we just have a user on the screen or
were we looking for one ?
to estimate the amount of enters at
the end
}
Begin
EverFound:=false;
If ParamStr(2)<>'' then
If Door.SecLvl<StrToInt(ParamStr(2)) then
Begin
AllWriteln('No rights to execute this door.');
AllWriteln('');
CloseAll;
Exit;
End;
TypeMCIFile('NAVTOP.PCB');
Input:=Allreadln(30);
If Input='' then
Begin;
EndSubLoop:=True;
Endloop:=True;
TypeMCIFile('NAVBORT.PCB');
End else
Begin;
GetMem(Control^.MCI^,SizeOf(MCIRecord));
AidMCI:=Control^.MCI^;
AidMCI^.mcistr:=ToUpcase(Input);
AidMCI^.NExt:=NIL;
TypeMCIFile('NAVSRCH.PCB');
AidMCI:=Control^.MCI^;
AidMCI:=Control^.MCI^;
FreeMem(Control^.MCI^,SizeOf(MCIRECORD));
End;
EndLoop:=False;SearchNode:=1;Found:=False;
ShowCont:=True;
JustShown:=False;
While not EndLoop do
Begin
If Exists(Config.Scripts+'\ANSWER'+IntToStr(SearchNode,0)+'.TXT') then
Begin;
{ ok, list exists }
Assign(f,Config.Scripts+'\ANSWER'+IntToStr(SearchNode,0)+'.TXT');
Reset(f);
Readln(f,Temp_str);
EndSubLoop:=False;
While not EndSubLoop do
Begin
If Eof(f) then EndSubLoop:=True else
If (Chobstring(Temp_str,5,5,false)='\----') then
Begin { this is a string, the next line gives the username }
Readln(f,Temp_str);
Username:='';
i:=11;
While (i<=Length(Temp_Str)) and (Temp_str[i]<>',') do
Begin
Username:=Username+Temp_str[i];
Inc(i);
End;
For i:=1 to (Length(Username)-Length(Input))+1 do
If ToUpcase(Copy(Username,i,Length(Input)))=
ToUpcase(Input) then
Begin { found! }
{ show it! }
EverFound:=True;
GetMem(Control^.MCI^,SizeOf(MCIRecord));
AidMCI:=Control^.MCI^;
AidMCI^.mcistr:=Username;
AidMCI^.NExt:=NIL;
TypeMCIFile('NAVFND.PCB');
AidMCI:=Control^.MCI^;
AidMCI:=Control^.MCI^;
FreeMem(Control^.MCI^,SizeOf(MCIRECORD));
C:=AllGetch;
If Upcase(Chr(C))='Q' then
Begin;
EndLoop:=True;
EndSubLoop:=True;
AllWriteln('Quit');
AllWriteln('');
AllWriteln('');
End else
If Upcase(Chr(C))<>'N' then
Begin
JustShown:=True;
AllWriteln('Yes');
AllWriteln('');
AllWriteln('');
TypeMCIFile('NAVHDR.PCB'); { header }
Found:=True;
While (Chobstring(Temp_str,5,5,false)<>'\----') and (not Eof(F)) do
Begin
AllWriteln(Temp_Str);
Readln(f,Temp_Str);
End;
{Show;}
TypeMCIFile('NAVCONT.PCB'); { continue searching ? }
C:=AllGetch;
If (ToUpcase(Chr(C))<>'N') and (ToUpcase(Chr(C))<>'Q') then
Begin
Allwrite('Yes');
AllWriteln('');
AllWriteln('');
Found:=False;
GetMem(Control^.MCI^,SizeOf(MCIRecord));
AidMCI:=Control^.MCI^;
AidMCI^.mcistr:=ToUpcase(Input);
AidMCI^.NExt:=NIL;
TypeMCIFile('NAVSRCH.PCB');
AidMCI:=Control^.MCI^;
AidMCI:=Control^.MCI^;
FreeMem(Control^.MCI^,SizeOf(MCIRECORD));
End else
Begin
Allwrite('No');
AllWriteln('');
AllWriteln('');
EndSubloop:=True;
EndLoop:=True;
End;
End else
Begin;
ShowCont:=False;
Found:=False;
AllWriteln('No');
AllMoveUp(3);
JustShown:=False;
End;
End
End else Readln(f,Temp_str);
End; { sub }
Close(f);
End; { exist }
Inc(SearchNode);
If SearchNode>Config.Howmanynodes then EndLoop:=True;
end; {endloop }
If not Found then
Begin
If (not JustShown) and (Input<>'') and EverFound then
Begin
AllWriteln('');
AllWriteln('');
AllWriteln('');
AllWriteln('');
End;
TypeMCIFile('NAVNOT.PCB');
End;
CloseAll;
End.