Bonjour,
Je lis des valeurs dans un fichier ini et à la lecture de l'une d'elle j'obtiens un message d'erreur:
List index out of bound (1).
Voici le code de lecture:
Le message apparait lors de la lecture de la ligne en rouge.
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 if fileExists(ChangeFileExt(Application.ExeName,'.cfg')) then begin try IniFile := TIniFile.Create(ChangeFileExt(Application.ExeName,'.cfg')); Str := IniFile.ReadString('PATHS', 'FS9',''); edFS9Path.Text := Str; if edFS9Path.Text <> '' then edFS9Path.Color:= clWhite; edFS9PlnPath.Text:= IniFile.ReadString('PATHS', 'ROUTES FS9',''); if edFS9PlnPath.Text <> '' then edFS9PlnPath.Color:= clWhite; Str:= IniFile.ReadString('PATHS', 'FSX/SE', ''); edFSXPath.Text:= Str; if edFSXPath.Text <> '' then edFSXPath.Color:= clWhite; edFSXPlnPath.Text:= IniFile.ReadString('PATHS', 'ROUTES FSX/SE', ''); if edFSXPlnPath.Text <> '' then edFSXPlnPath.Color:= clWhite; edAsFsxPath.Text:= IniFile.ReadString('PATHS', 'Active Sky FSX', ''); if edAsFsxPath.Text <> '' then edAsFsxPath.Color:= clWhite; ....
Voici le fichier lu:
Auriez vous une idée?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 [PATHS] FS9= ROUTES FS9= FSX/SE=D:\Microsoft Games\Flight Simulator X ROUTES FSX/SE=C:\Users\Administrateur\Documents\Fichiers FS2004 P3D= ROUTES P3D= Active Sky FSX=D:\Program Files (x86)\HiFi\AS16_FSX Active Sky P3D= DefaultReportFolder=C:\Users\Administrateur\Documents\TestReport\
Merci
Cordialement
Pierre
Partager