AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Internet to Listview
Thema durchsuchen
Ansicht
Themen-Optionen

Internet to Listview

Ein Thema von RedShakal · begonnen am 12. Aug 2009 · letzter Beitrag vom 15. Aug 2009
Antwort Antwort
RedShakal
(Gast)

n/a Beiträge
 
#1

Re: Internet to Listview

  Alt 15. Aug 2009, 20:19
Delphi-Quellcode:
function Explode(const Separator, S :String; Limit :Integer = 0): TDynStringArray;
  var
    SepLen: Integer;
    F, P: PChar;
begin
  SetLength(Result, 0);
  if (S = '') or (Limit < 0) then
    Exit;
  if Separator = 'then
    begin
      SetLength(Result, 1);
      Result[0] := S;
      Exit;
    end;
  SepLen := Length(Separator);

  P := PChar(S);
  while P^ <> #0 do
    begin
      F := P;
      P := AnsiStrPos(P, PChar(Separator));
      if (P = nil) or ((Limit > 0) and (Length(Result) = Limit - 1)) then
        P := StrEnd(F);
      SetLength(Result, Length(Result) + 1);
      SetString(Result[High(Result)], F, P - F);
      F := P;
      if P = Separator then
        SetLength(Result, Length(Result) + 1);
      while (P^ <> #0) and (P - F < SepLen) do
        Inc(P);
    end;
end;


procedure TForm6.Button3Click(Sender: TObject);
var
  Maps : string;
  LI : TListItem;
  StrArr : TDynStringArray;
begin

 if Form1.Client.Connected = false then
    begin
      Form1.Client.Connect(3000);
    end;

  Form1.Client.WriteLn('Maplist');

  repeat
    Maps := Form1.Client.ReadLn;

    if Length(Maps) > 0 then
      begin
        Maplist.Clear;
        StrArr := Explode('|', Maps);
        LI := Maplist.Items.Add;
        LI.Caption := StrArr[2];
        LI.SubItems.Add(StrArr[4]);
        LI.SubItems.Add(StrArr[3]);
        i := i+1;
      end;
  until
    i = StrToInt(StrArr[1]);
    Form1.Client.Disconnect;
end;

procedure TForm6.FormCreate(Sender: TObject);
begin
  i := 1;
end;

end.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:39 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz