ok hab das 2te problem jetzt so gelöst:
Delphi-Quellcode:
function Without(const s: string; charSet: TSysCharSet): string;
var
i, iDel: Integer;
begin
Result := s;
iDel := 0;
for i := 1 to Length(s) do
if not (s[i] in charSet)
then Result[i - iDel] := s[i]
else Inc(iDel);
SetLength(Result, Length(s) - iDel);
end;
function LastWord(const s, delimiters: string): string;
var
iPos, iLength: Integer;
begin
iPos := LastDelimiter(delimiters, s);
iLength := Length(s) - iPos;
Result := AnsiRightStr(s, iLength);
end;
procedure TForm1.FormShow(Sender: TObject);
const
DIGITS = ['"'];
var
t1, t2, t3: String;
begin
memo1.Lines.LoadFromFile('server.cfg');
for i := 0 to Memo1.Lines.Count - 1 do
begin
if Pos('servername' , Memo1.Lines.Strings[i]) <> 0 then
t1:= Memo1.Lines.Strings[i];
t2:= Without(t1, DIGiTS);
t3:= LastWord(t2, '=');
edit1.Text:= t3
end;
Nur zum ersten is mir immer noch net viel eingefallen