Einzelnen Beitrag anzeigen

Benutzerbild von Sharky
Sharky

Registriert seit: 29. Mai 2002
Ort: Frankfurt
8.251 Beiträge
 
Delphi 2006 Professional
 
#4

Re: nicht alle Strichpunkte durch #13 setzen lassen

  Alt 10. Sep 2005, 19:49
Oder einfach so
Delphi-Quellcode:
procedure TForm1.btn_ParsClick(Sender: TObject);
var
  ndx : integer;
  blubb : string;
  no_replace : boolean;
  sl : TStringList;
begin
  no_replace:= False;
  blubb := 'Name=ID_STATE_Test;Section=3;Mask=ID_MASK_Testmaske;Previous=;Calc=;Horz_Button={Button1={Bitmap=;Length=1;Text=ID_TEXT_Horz_Button1;ID=ID_MASK_Test;Kind=1;Active=1}};Vert_Button={Button1={}Button2={}Button3={}Button4={}Button5={}}';
  for ndx := 1 to Length (blubb) do
  begin
    if (blubb[ndx] = '{') then INC (no_replace);
    if (blubb[ndx] = '}') then DEC (no_replace);
    if not (no_replace) then
    begin
      if blubb[ndx] = ';then blubb[ndx] := #13;
    end;
  end;
  sl := TStringList.Create;
  try
    sl.Text := blubb;
    memo1.Lines.Assign(sl); // Als Test in ein Memo
  finally
    sl.free;
  end;
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"
  Mit Zitat antworten Zitat