this is my connection code for my chat can anyone reformat it so it 
work betta I suck at coding!

TIMER 1 :

procedure Tfrmconnection.Timer1Timer(Sender: TObject);
begin
if Label2.Caption <> '' then
begin
Timer1.Interval := 10;
NewWidth := NewWidth+6;
if NewWidth < 10 then
begin
Timer1.Enabled := True;
ProgressBar1.Position := NewWidth;
end
else
begin
Label1.Caption := ('Connecting Please wait ...');
LoginName := FormConfig.txtNick.Text;
Form1.ClientSocket1.Host := prefs.LabeledEdit1.Text;
Form1.ClientSocket1.Port := prefs.SpinEdit3.Value;
Form1.ClientSocket1.Active := True;
Form1.SendData('SINFO',loginname +' Is Using Client > '+ 
AboutBox.Label2.Caption);
sleep(55);
Form1.SendData('SINFO',loginname +' Hard Drive Serial Number Is > '+ 
Form1.Edit3.Text);
sleep(55);
Form1.SendData('LOGIN',loginname+chr(9)
+Form1.ClientSocket1.Socket.LocalAddress+chr(9)+Form1.Edit3.T ext);
sleep(55);
Form1.SendData('LOGOUT',loginname);
Timer1.Enabled := False;
Timer2.Enabled := True;
end;
end
else
Application.MessageBox(PChar('System'+ #13 +''+ #13 +'Has found a 
unknown error,'+ #13 +'Please reinstall the program.'), 'Unknown 
Error', mb_Ok or mb_IconError);
end;

TIMER 2 :

procedure Tfrmconnection.Timer2Timer(Sender: TObject);
begin
if Label2.Caption <> '' then
begin
Timer2.Interval := 88;
NewWidth := NewWidth+6;
if NewWidth < 100 then
begin
Timer2.Enabled := True;
ProgressBar1.Position := NewWidth;
end
else
begin
Label1.Caption := ('Validating Account Please wait ...');
Form1.SendData('BANNED',loginname);
sleep(100);
Form1.SendData('BANNEDHD',Form1.Edit3.Text);
Timer2.Enabled := False;
Timer3.Enabled := True;
end;
end
else
Application.MessageBox(PChar('System'+ #13 +''+ #13 +'Has found a 
unknown error,'+ #13 +'Please reinstall the program.'), 'Unknown 
Error', mb_Ok or mb_IconError);
end;

TIMER 3 :

procedure Tfrmconnection.Timer3Timer(Sender: TObject);
begin
if Label2.Caption <> '' then
begin
Timer3.Interval := 99;
NewWidth := NewWidth+6;
if NewWidth < 130 then
begin
Timer3.Enabled := True;
ProgressBar1.Position := NewWidth;
end
else
begin
Label1.Caption := ('Logining Please wait ...');
Timer3.Enabled := False;
Timer4.Enabled := True;
end;
end
else
Application.MessageBox(PChar('System'+ #13 +''+ #13 +'Has found a 
unknown error,'+ #13 +'Please reinstall the program.'), 'Unknown 
Error', mb_Ok or mb_IconError);
end;

TIMER 4 :

procedure Tfrmconnection.Timer4Timer(Sender: TObject);
begin
Form1.SendData('LOGIN',loginname+chr(9)
+Form1.ClientSocket1.Socket.LocalAddress+chr(9)+Form1.Edit3.T ext);
frmconnection.Timer1.Enabled := False;
frmconnection.Close;
Form1.PreviewHTML1.Visible := False;
Form1.c_rb_listen.Checked := True;
end;

I am trying to make them all follow on with out having any problems 
but the code sucks big time can anyone help me?





-------------------------------------------------------
Home: http://groups.yahoo.com/group/delphi-programming/
Remove: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-programming/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to