Autor Beitrag
Airborne
Hält's aus hier
Beiträge: 1

Win XP, Knoppix-Linux, SUSE-Linux 9.3
Delphi 2005
BeitragVerfasst: So 06.11.05 12:18 
Delphi-Neuling sucht Hlfe!

Liebe Delphine und Delphianer!

Ich muss für meinen Informatik-Unterricht eine Tankrechnung erstellen, mit etlichen Funktionen, doch bei einer Funktion bin ich hängen geblieben:

eingegeben werden soll: getankter Kraftstoff in Liter
und Volumen des Tanks

Progressbar soll beim Tanken mitlaufen,
Volumen des Tanks entspricht 100%
Wenn ich nun angebe, dass der Tank 60Liter Volumen hat, der Kunde aber nur 30 Liter Tank, soll die Progress bar bis 50% laufen, und dann anhalten. Bei mir läuft sie aber durchgängig bis 100% voll.

Wo steckt der Fehler??
Bitte um Hilfe
Gruß
Markus

_________________
"Life is not a matter of counting the years,
it's making the years count! "
DarkLord05
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 449

WinXP Pro SP2
Opera; Delphi 3 Pro; Delphi 2005, Turbo Delphi, dev-c++, Eclipse, MS Visual Studio .NET 2003, MS Visual C++
BeitragVerfasst: So 06.11.05 12:25 
Um da zu helfen musst / solltest du mal ein bisschen von dem Quelltext zeigen, da es sonst schwer ist zu sagen was falsch ist.
starsurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 334

Win 95, Win 98, Win XP, Win Vista, Linux
D5 Enterprise ,D2005, D6 Personal, Visual C++ Express 2005, C++ Builder 6 E, Dev-C++
BeitragVerfasst: So 06.11.05 12:29 
ohne deinen code wissen wir nich wo dein fehler stecken könnte :D

mal wild vermutet: du hast n timer genommen und vergessen den aus zu schalten :o

_________________
GEIZ IST GEIL! - Ihr Sozialamt
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 06.11.05 12:43 
Du brauchst Nur mit eine Variable. bsp.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
var
  Form1: TForm1;
  i:Integer;
implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  i:=StrToInt(Edit1.Text);
  Progressbar1.Position:=i;
  if Progressbar1.Position=I then Timer1.Enabled:=False;
  Progressbar1.stepit;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Progressbar1.Position:=0;
  Timer1.Enabled:=True;
end;