Problema !
15/07/2003
0
Programa cliente envia :
rocedure TForm1.Timer1Timer(Sender: TObject);
var
i: integer;
begin
i:=0;
if SpeedButton1.Down=true then
i:=i+1;
if SpeedButton2.Down=true then
i:=i+2;
if SpeedButton3.Down=true then
i:=i+4;
if SpeedButton4.Down=true then
i:=i+8;
if SpeedButton5.Down=true then
i:=i+16;
if SpeedButton6.Down=true then
i:=i+32;
if SpeedButton7.Down=true then
i:=i+64;
if SpeedButton8.Down=true then
i:=i+128;
ClientSocket1.Socket.SendText(inttostr(i));
E o programa servidor recebe:
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
comando: string;
begin
comando:= Socket.ReceiveText;
ParallelPort1.Data:= StrToInt (comando);
O problema é o seguinte, quando fico enviando dados direto para o servidor a partiri do cliente, chega uma hora que dá este erro: ... Is not a valid integer value, isto se deve pois ao servidor receber as integers, ele está confundindo, está juntando uma com outra.
GOSTARIA DE SABER se tem um jeito de fazer com que o servidor não confunda as integers.
RODRIGO!
rocedure TForm1.Timer1Timer(Sender: TObject);
var
i: integer;
begin
i:=0;
if SpeedButton1.Down=true then
i:=i+1;
if SpeedButton2.Down=true then
i:=i+2;
if SpeedButton3.Down=true then
i:=i+4;
if SpeedButton4.Down=true then
i:=i+8;
if SpeedButton5.Down=true then
i:=i+16;
if SpeedButton6.Down=true then
i:=i+32;
if SpeedButton7.Down=true then
i:=i+64;
if SpeedButton8.Down=true then
i:=i+128;
ClientSocket1.Socket.SendText(inttostr(i));
E o programa servidor recebe:
procedure TForm1.ServerSocket1ClientRead(Sender: TObject;
Socket: TCustomWinSocket);
var
comando: string;
begin
comando:= Socket.ReceiveText;
ParallelPort1.Data:= StrToInt (comando);
O problema é o seguinte, quando fico enviando dados direto para o servidor a partiri do cliente, chega uma hora que dá este erro: ... Is not a valid integer value, isto se deve pois ao servidor receber as integers, ele está confundindo, está juntando uma com outra.
GOSTARIA DE SABER se tem um jeito de fazer com que o servidor não confunda as integers.
RODRIGO!
Ropesca
Curtir tópico
+ 0
Responder
Clique aqui para fazer login e interagir na Comunidade :)