Lorsque j'execute mon projet, il me rest des messages en bas de mon .pas principal du style :
[Warning] FenetrePrincipal.pas(621): Variable FichierIni might not have been initialized
[Hint] FenetrePrincipal.pas(928): Value assigned to 'calculduWidth' never used
Alors evidement je comprends les phrases des messages.
Mais cela ne pose aucun problème d'execution.
De plus je les trouvent faux ces infos.
Le cout du [Hint].... never used, je pige pas ma variable est bien mis à 0 et ensuite affecté.
Exemple pour le CalculDuWidth
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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 Procedure TFormPrincipal.MiseEnPlaceDesTPanelJourDejaExistant; Var ..... CalculDuWidth, CalculDuTop, CalculDuHeight: Integer; ..... Begin ..... ..... CalculDuLeft := 0; CalculDutop := 0; CalculDuHeight := 0; CalculDuWidth :=0; .... .... CalculDuLeft := StringGridJour.ColWidths[0] + (i * StringGridJour.DefaultColWidth); CalculDuTop := StringGridJour.RowHeights[0] + (oldTop * StringGridJour.DefaultRowHeight); .... CalculDuHeight := ADOCalendrier.Fields.Fields[9].AsInteger * StringGridJour.DefaultRowHeight; CalculDuWidth := StringGridJour.DefaultColWidth; .... Panel := TRuPanel.Create(Self); With Panel do Begin Parent := Self.StringGridJour; .... Left := CalculDuLeft; Top := CalculDuTop; Width := CalculDuWidth-1; Height := CalculDuHeight; ...;
Et pour le [Warning]....not have been initialized
Vous pouvez m'expliquer ?
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
19
20
21
22 Procedure TFormPrincipal.RemplirGrid; var .... FichierIni : TInifile; begin ... Try FichierIni:=TIniFile.Create(ExtractFilePath(Application.ExeName)+'xxxxxx.ini'); // Ouvre ou crée le fichier for i := 1 To 7 do Begin if FormatDateTime('dddd',Calendrier.Date) = AnsilowerCase(Jours[i]) then repere := i end; for i:= 1 To 7 do begin ..... ..... end; finally FichierIni.free; end; .... end;
Partager