Ich Empfang vor allen Pakete die Ladebalken hin und her Setzten.
Wisst Ihr woran das liegen kann?
Code: Alles auswählen
procedure TForm1.SetLevel(const id : integer; opos: String);
var
npos : integer;
begin
npos := StrToInt(Copy(opos,0,Pos('.',opos)-1));
if id = 7 then
lv_07.Position:= npos
else if LLevel[id] <> nil then
LLevel[id].Position:= npos;
end;
procedure TForm1.TCPReceive(aSocket: TLSocket);
var
msg : String;
Info: TStrings;
dos : TStrings;
I : Integer;
begin
try
aSocket.GetMessage(msg);
Info := nil;
dos := Explode(msg,';');
for i := 0 to dos.Count -1 do begin
msg := dos[i];
//log.d('TCP '+msg);
if msg <> '' then begin
info := Explode(msg,',');
if info[0] = 'c' then begin
chat.memo1.Lines.Add(copy(msg,3,999));
chat.show;
end
else if info[0] = 'l' then
SetLevel(StrToInt(info[1]),info[2])
else if info[0] = '0' then
ShowMessage(info[1])
else if info[0] = '1' then
SetSlider(StrToInt(info[2]),StrToInt(info[3]))
else if info[0] = '2' then
if info[2] <> '7' then begin
LPanel[StrToInt(info[2])].Visible:= (info[3] <> '');
LText[StrToInt(info[2])].Caption:=info[3];
end;
end;
end;
StatusBar1.Panels[0].Text:='Verbunden';
if Info <> nil then Info.Free;
if dos <> nil then dos.free;
except
aSocket.Disconnect(true);
end;
end;