Displaying multiple inputs simultaneously

Please discuss general Delphi programming topics here.

Postby david griffith » September 10th, 2005, 6:47 pm

Well here are the files. The idea behind the project is to create a more natural method for passing the time parameters to the unit without having to work the usual way round the typical selection routine normally encountered with central heating units.

This is still not quite ready yet. You need to press clear before you start but you should soon get the general idea. The clear key should backspace for the last character input, then drop out of the setting action, and the time set by a new sequence should also be set in registers or update the actual display, so you can see there is still much to do. I do hope this helps you and once again thanks go to Stefan for the help in getting this started.
Attachments
PushIT.zip
(15.65 KiB) Downloaded 150 times
Thanks and Regards, David
david griffith
Active Member
Active Member
 
Posts: 10
Joined: April 13th, 2005, 4:37 pm
Location: London, England

Postby Stefan » September 12th, 2005, 10:21 am

Hi David,

Just had a quick look at your code (couldn't resist :) ) and found a (tiny little) bug in AddNumberToEdit():

Code: Select all
procedure TForm1.AddNumberToEdit(Sender: TObject);
begin
  Edit14.Text := '         USER INPUT MODE';
  Edit1.Text := Edit1.Text + IntToStr((Sender as TComponent).Tag);
   (FindComponent('Edit'+IntToStr(WhichArray+1)) as TEdit).Text := arrays[(FindComponent('Edit'+IntToStr(WhichArray+1)) as TEdit).Tag, (Sender as TComponent).Tag];
  Inc(WhichArray);
  if WhichArray > 11 then
  WhichArray := 1;
end;


should be:

Code: Select all
procedure TForm1.AddNumberToEdit(Sender: TObject);
begin
  Edit14.Text := '         USER INPUT MODE';
  Edit1.Text := Edit1.Text + IntToStr((Sender as TComponent).Tag);
  try
     (FindComponent('Edit'+IntToStr(WhichArray+1)) as TEdit).Text := arrays[(FindComponent('Edit'+IntToStr(WhichArray+1)) as TEdit).Tag, (Sender as TComponent).Tag];
  except
  end;
  Inc(WhichArray);
  if WhichArray > 11 then
  WhichArray := 1;
end;


Because WhichArray can be 12 (11+1 in the FindComponent part) and that'll give an AV, putting a try except around it catches that error and makes sure the rest of the procedure is still executed... Just a quick fix :)
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

Postby david griffith » September 12th, 2005, 7:30 pm

Hi Stefan,

I tried this fix and it works a treat. The zeros now work and I can now begin to work on the other bits. Thank you.
Thanks and Regards, David
david griffith
Active Member
Active Member
 
Posts: 10
Joined: April 13th, 2005, 4:37 pm
Location: London, England

Previous

Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 15 guests

cron