Board index » delphi » Label11.caption := Label11.caption????

Label11.caption := Label11.caption????

Hi guys,

I got the following method on my form, reffered to by the OnDataArrival-Event
of
an Array of TTCP.
I passes its Sender-parameter unchanged to TForm1.Process.
My question is: If I remove that marked line (Label11.caption :=
Label11.caption; nonsense)
I get an EAccessViolation at an unknown address.
Instead of that line I could write almost everything, but if I remove it
completely, I
get that error.

THX for help!!

PROCEDURE TForm1.Process(Sender: TObject; data: string);
VAR No: byte;
    Temp: string;
LABEL ende;

BEGIN
  No:=TTCP(sender).Tag;                                         // No:
Arrayindex
  IF (ServStat[No]=ssLogOn) THEN BEGIN                  // Only do that
when just logging on
    IF pos('NICK ',UpperCase(data))=0 THEN Goto Ende; // Only continue if found
'NICK '
    Temp:=copy(data, pos('NICK ',UpperCase(data) ) + 5,  // Copy the part right
from 'NICK '
                                Length(data)-Pos('NICK ',UpperCase(data))+5);

--> Label11.caption:=Label11.caption;                        // ???????

    IF IsIn(Nicks, temp) then begin                             // If temp is a
member of array of strings NICKS
      TCPs[no].senddata('- Nickname already taken'+#13+#10); // Send Message
      CloseConn(no);                                            // Close
connection & Cleanup
    END ELSE BEGIN
      nicks[no]:=Temp;                                          // else put
name into NICKS-Array
    END;
  END;
  ende:
END;

Oliver Rahner

 

Re:Label11.caption := Label11.caption????


Is it ENDe;
Shouldn't it be ENDe:(colon not semicolon)
HTH
Bob

Other Threads