var Form1: TForm1; min:integer; sec:integer; heur:integer; tarifbase:integer; tempsbase:integer; tempstotal:integer; Prix:integer; Monai:string; implementation {$R *.dfm} Procedure Onstart; Begin min:=0; sec:=0; heur:=0; //Variables relatives a la tarification (valeurs test en attendant d'effectuer //la liaison avec le serveur + enregistrement tarifbase:=5; tempsbase:=5; tempstotal:=0; Prix:=tarifbase; Monai:='Coins'; end; procedure TForm1.Timer1Timer(Sender: TObject); //Calcul total minutes (sur la base d'une tarification à la minute) Tempstotal:= min+(heur*60); //Calcul du prix begin If tempstotal >= tempsbase then Prix:=prix+tarifbase; tempstotal:=tempstotal-tempsbase; end; //affichage du prix sur le caption du label Label7.Caption:=inttostr(prix); end; procedure TForm1.Button1Click(Sender: TObject); begin Timer1.Enabled :=True; Button1.enabled:=false; Label7.Caption:=inttostr(tarifbase); end; end.
procedure TForm1.Timer1Timer(Sender: TObject); //Calcul total minutes (sur la base d'une tarification à la minute) Tempstotal:= min+(heur*60); //Calcul du prix begin If tempstotal >= tempsbase then Prix:=prix+tarifbase; tempstotal:=tempstotal-tempsbase; end; //affichage du prix sur le caption du label Label7.Caption:=inttostr(prix); end;
procedure TForm1.Timer1Timer(Sender: TObject); begin //Calcul total minutes (sur la base d'une tarification à la minute) Tempstotal:= min+(heur*60); //Calcul du prix If tempstotal >= tempsbase then Prix:=prix+tarifbase; tempstotal:=tempstotal-tempsbase; //affichage du prix sur le caption du label Label7.Caption:=inttostr(prix); end;
Label7.Caption:=inttostr(prix);
//Calcul total minutes (sur la base d'une tarification à la minute) Tempstotal:= min+(heur*60); //Calcul du prix If tempstotal >= tempsbase then Prix:=prix+tarifbase; tempstotal:=tempstotal-tempsbase; //affichage du prix sur le caption du label Label7.Caption:=inttostr(prix);
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionProcedure Onstart; Begin min:=0; sec:=0; heur:=0; //Variables relatives a la tarification (valeurs test en attendant d'effectuer //la liaison avec le serveur + enregistrement tarifbase:=5; tempsbase:=5; tempstotal:=0; Prix:=tarifbase; Monai:='Coins'; end;
procedure TForm1.Button1Click(Sender: TObject); begin //Initialisation variales temps tempsbase:=0; tempstotal:=0; //Monai Monai:='DA'; //Initialisation du Compteur Ix:=1; //valeurs test (tarifbase et tempsbase) en attendant d'effectuer //la liaison avec le serveur + enregistrement tarifbase:=5; tempsbase:=5; Timer1.Enabled :=True; Button1.enabled:=false; Prix:=tarifbase; Label7.Caption:=inttostr(prix); end;
Procedure Onstart; Begin min:=0; sec:=0; heur:=0; end;
//Calcul du prix If Ix=(tempsbase*60)then begin Prix:=prix+tarifbase; Ix:=1; //affichage du prix sur le caption du label Label7.Caption:=inttostr(prix); end else ix:=ix+1;