Hi, I'm working on editing a program I did not originally make. I'm quite new to delphi and understand most the basics but not all. I have two issues I would be greatful if someone could help with.
1. The following line of coding is used to connect to the server. How could I get it so that if the connection is failed it displays a showMessage error.
procedure TForm1.ConnectButtonClick(Sender: TObject);
begin
ClientSocket.Host := IPaddressEdit.Text;
ClientSocket.port := 10000;
ClientSocket.Active := true;
end;
2. The 2nd issue is alot simpler but something I've never learn as I've not used it before. The following type is declared:
type TPerson = record
toDo : tToDo;
Name : String[20];
PhoneNo : String[20];
Age : real;
Football : boolean;
end;
I then have a line on another part of the program (search part) which does a loop through the record/array and then checks whether the boolean value for football is the same as the value from the form and if so proceeds. I only need it to proceed if the value is set to true but currently it proceeds if both are set to false and both are set to true.
If (registeredPeople
.Football = FootballCheckbox.checked) then
I would be greatful if anyone could help. Thanx
1. The following line of coding is used to connect to the server. How could I get it so that if the connection is failed it displays a showMessage error.
procedure TForm1.ConnectButtonClick(Sender: TObject);
begin
ClientSocket.Host := IPaddressEdit.Text;
ClientSocket.port := 10000;
ClientSocket.Active := true;
end;
2. The 2nd issue is alot simpler but something I've never learn as I've not used it before. The following type is declared:
type TPerson = record
toDo : tToDo;
Name : String[20];
PhoneNo : String[20];
Age : real;
Football : boolean;
end;
I then have a line on another part of the program (search part) which does a loop through the record/array and then checks whether the boolean value for football is the same as the value from the form and if so proceeds. I only need it to proceed if the value is set to true but currently it proceeds if both are set to false and both are set to true.
If (registeredPeople
![[pc] [pc] [pc]](/data/assets/smilies/pc.gif)
I would be greatful if anyone could help. Thanx