I have a Petrol Pump system that runs a timer that simulates the litres that run and the display shows the images inserting into an image box. Then the Price at current is the litres * the set price per litre.
Thats where the problem is because I can't get the Price of the sale working.
I understand the fact of helping with homework and that you won't just do it all for me, if you want to ask more questions then PM me and you can get my MSN if you need to explain in person.
procedure TfrmPump.Timer2Timer(Sender: TObject);
var
n1,n2,n3,n4,n5:char;
thissalestr,tempstr:string[5];
i:integer;
begin
thissale:= (PriceLitre)*(litres/10) ;
thissaleStr:=floattostr(thissale);
for i:=1 to length(thissalestr) DO
IF thissalestr <> '.' THEN
tempstr:=tempstr+ thissalestr;
begin
While Length(tempstr) <5 do
tempstr:='0'+tempstr;
Begin
n1:=thissaleStr[1];
n2:=thissaleStr[2];
n3:=thissaleStr[3];
n4:=thissaleStr[4];
n5:=thissaleStr[5];
Case n1 of
'0':Img1.picture.loadfromfile('0.bmp');
'1':Img1.picture.loadfromfile('1.bmp');
'2':Img1.picture.loadfromfile('2.bmp');
'3':Img1.picture.loadfromfile('3.bmp');
'4':Img1.picture.loadfromfile('4.bmp');
'5':Img1.picture.loadfromfile('5.bmp');
'6':Img1.picture.loadfromfile('6.bmp');
'7':Img1.picture.loadfromfile('7.bmp');
'8':Img1.picture.loadfromfile('8.bmp');
'9':Img1.picture.loadfromfile('9.bmp');
End;
Case n2 of
'0':Img2.picture.loadfromfile('0.bmp');
'1':Img2.picture.loadfromfile('1.bmp');
'2':Img2.picture.loadfromfile('2.bmp');
'3':Img2.picture.loadfromfile('3.bmp');
'4':Img2.picture.loadfromfile('4.bmp');
'5':Img2.picture.loadfromfile('5.bmp');
'6':Img2.picture.loadfromfile('6.bmp');
'7':Img2.picture.loadfromfile('7.bmp');
'8':Img2.picture.loadfromfile('8.bmp');
'9':Img2.picture.loadfromfile('9.bmp');
End;
Case n3 of
'0':Img3.picture.loadfromfile('0.bmp');
'1':Img3.picture.loadfromfile('1.bmp');
'2':Img3.picture.loadfromfile('2.bmp');
'3':Img3.picture.loadfromfile('3.bmp');
'4':Img3.picture.loadfromfile('4.bmp');
'5':Img3.picture.loadfromfile('5.bmp');
'6':Img3.picture.loadfromfile('6.bmp');
'7':Img3.picture.loadfromfile('7.bmp');
'8':Img3.picture.loadfromfile('8.bmp');
'9':Img3.picture.loadfromfile('9.bmp');
End;
Case n4 of
'0':Img4.picture.loadfromfile('0.bmp');
'1':Img4.picture.loadfromfile('1.bmp');
'2':Img4.picture.loadfromfile('2.bmp');
'3':Img4.picture.loadfromfile('3.bmp');
'4':Img4.picture.loadfromfile('4.bmp');
'5':Img4.picture.loadfromfile('5.bmp');
'6':Img4.picture.loadfromfile('6.bmp');
'7':Img4.picture.loadfromfile('7.bmp');
'8':Img4.picture.loadfromfile('8.bmp');
'9':Img4.picture.loadfromfile('9.bmp');
end;
Case n5 of
'0':Img5.picture.loadfromfile('0.bmp');
'1':Img5.picture.loadfromfile('1.bmp');
'2':Img5.picture.loadfromfile('2.bmp');
'3':Img5.picture.loadfromfile('3.bmp');
'4':Img5.picture.loadfromfile('4.bmp');
'5':Img5.picture.loadfromfile('5.bmp');
'6':Img5.picture.loadfromfile('6.bmp');
'7':Img5.picture.loadfromfile('7.bmp');
'8':Img5.picture.loadfromfile('8.bmp');
'9':Img5.picture.loadfromfile('9.bmp');
end;
end;
end;
end;
end.