Bonjour à tous,
j'ai une procédure qui se trouve dans une autre unité, j'arrive à l'appeler (j'ai ajouté uses Unit2) dans l'unit1.
Mais dans cette Procédure, j'ai des références à l'Unit1, et je souhaiterais que ces références soient des variables (c'est à dire remplacer Unit1. par une variable).
Voila mon code :
et je souhaiterai avoir
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 Procedure CalculPrix; var Total1 : String; TotalRemise1, TotalRemise2, TotalGeneral : real; TempRemise1, TempRemise2 : extended; begin if Unit1.Edit1.Text <> '0' then begin TotalRemise1 := StrToInt(Unit1.Edit1.Text) * Total; TotalRemise1 := TotalRemise1 / 100; TempRemise1 := Total - TotalRemise1; Unit1.Label91.Caption := FormatFloat('0.00', RoundTo(TotalRemise1,-2)) + ' '; end else begin Unit1.Label91.Caption := '0 '; end;
C'est possible?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 Procedure CalculPrix; var Total1 : String; TotalRemise1, TotalRemise2, TotalGeneral : real; TempRemise1, TempRemise2 : extended; begin if Nom_de_unit_variable.Edit1.Text <> '0' then begin TotalRemise1 := StrToInt(Nom_de_unit_variable.Edit1.Text) * Total; TotalRemise1 := TotalRemise1 / 100; TempRemise1 := Total - TotalRemise1; Nom_de_unit_variable.Label91.Caption := FormatFloat('0.00', RoundTo(TotalRemise1,-2)) + ' '; end else begin Nom_de_unit_variable.Label91.Caption := '0 '; end;
Merci
Partager