Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Boolean value and Server Connect Failure Error

Status
Not open for further replies.

jgd12345

Technical User
Apr 22, 2003
124
GB
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[pc].Football = FootballCheckbox.checked) then

I would be greatful if anyone could help. Thanx
 
hi

1. try... except...
2. you have to declare(initialize) the Football record to true or false;
if Foottball = FtballChkBox.Checked then
... bla.. bla..

hopes it helps...

cheers,
mha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top