home *** CD-ROM | disk | FTP | other *** search
- Unit Extract;
-
- INTERFACE
-
- Uses dos;
-
- FUNCTION GetLogPath(eintrag:string;wo:string):string;
-
-
- IMPLEMENTATION
-
- FUNCTION Back(s:STRING):STRING;
- BEGIN
- Back:=s;
- IF (Length(s)>0) AND (s[Length(S)]<>'\') THEN
- Back:=s+'\'
- END;
-
- FUNCTION LTrim(St:STRING):STRING;
-
- Begin
- WHILE (Length(St)>0) AND ( (St[1]=#32) OR (St[1]=#9) ) DO begin
- Delete(St,1,1);
- LTrim:=St;
- end;
- LTrim:=St;
- end;
-
- FUNCTION RTrim(St:STRING):STRING;
-
- Begin
- WHILE (Length(St)>0) AND ( (St[Length(St)]=#32) OR (St[Length(St)]=#9) ) DO begin
- Delete(St,Length(St),1);
- RTrim:=St;
- END;
- RTRIM:=St;
- end;
-
- FUNCTION Trim(St:STRING):STRING;
-
- BEGIN
- Trim:=LTrim(RTrim(St));
- END;
-
-
- FUNCTION UCase(St:STRING):STRING; {leicht modifiziert, es wird nur
- bis zum '=' umgewandelt, spart
- vielleicht noch eine Nanosekunde ;) }
- VAR
- i : BYTE;
- BEGIN
- FOR i:=1 TO pos('=',St) DO
- St[i]:=UpCase(St[i]);
- UCase:=St;
- END;
-
- FUNCTION GetLogPath(eintrag:string;wo:string):string;
-
- VAR t:text;
- found:boolean;
- p:byte;
- s:string;
-
- BEGIN
- found:=false;
- assign(t,wo);
- reset(t);
- while not (eof(t) or (found=true)) do
- begin
- readln(t,s);
- if not ( (pos('#',s)>0) or (pos('=',s)=0) ) then
- if (pos(eintrag,ucase(s))>0) then
- found:=true;
- end;
- close(t);
- if found then
- begin
- p:=pos('=',s);
- Delete(s,(p-(p-1)),p);
- GetLogPath:=Back(Trim(s));
- end
- else GetLogPath:='\';
- end;
- END.