Voila, depuis un ptit moment, j'ai un ptit problème de Files dans mon programme (console application).

Prob : dans une procédure, j'enregistre des détails dans trois différents fichiers (examinerfile, centrefile and subjectfile). Jusque là pas de soucis mais une fois que je veux montrer ces détails dans la blackscreen, il n'y a que quelques noms à l'écran. Je ne pige pas très bien pourquoi il ne veut pas montrer tous les détails.

Si vous pouviez me montrer mon erreur, ou ce que je dois faire ce serait gentil... Merci bien

Voilà mon code

1er : la procédure dans laquelle j'enregistre mes détails dans les fichiers
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Procedure NewDetails;
var a: integer;
    Position:longint;
begin
 if FileExists('C:\Documents and Settings\Braecking\Desktop\PROJECT DELPHI\Test Version\Examiner.dat')then     // change the position if you copy, cut the program !
  begin
   Assign(ExaminerFile, 'Examiner.dat');  // if file exists then take the right position in the file
   Reset (examinerFile) ;
   Position := Filesize(ExaminerFile);    //calcul the all the details registered
   Seek(ExaminerFile, Position);          //take the position after the last details registered (for a new request)
  end
 else
  begin
   AssignFile (ExaminerFile, 'Examiner.dat'); // if the file doesn't exist then create a new file
   Rewrite(ExaminerFile);
  end;
 AssignFile (SubjectFile, 'Subject.dat');
 Rewrite(SubjectFile);
 AssignFile (Centrefile, 'Centre.dat');
 Rewrite(CentreFile);
 Write ('How many examiner details do you want to enter? ');
 Readln (RepeatRequest);
 for a:= 1 to RepeatRequest
  do
  begin
   Writeln ('');
   Writeln ('NEW DETAILS N',a);
   Writeln ('--------------');
   Write (' Enter the examiner name: ');
   Readln (Examiner[a].ExaminerName);
   GetValidExaminerno;
   Write (' Enter the examiner address: ');
   Readln (Examiner[a].ExaminerAddress);
   Write (' Enter the total number of script marked: ');
   Readln (Examiner[a].TotalScripts);
   GetValidSubRefCode;
   Write (' Enter the subject name: ');
   Readln( Subject[a].SubjectName);
   Write (' Enter the payment for marking each script: ');
   Readln (Subject [a].SubPaymentScript);
   GetValidCentreno;
   Write (' Enter the centre name: ');
   Readln (Centre[a].Centrename);
   Write (ExaminerFile, Examiner[a]);
   Write (SubjectFile, Subject[a]);
   Write (CentreFile, Centre[a]);
  end;
 Closefile (ExaminerFile);
 Closefile (SubjectFile);
 Closefile (CentreFile);
 Writeln ('');
 Writeln ('');
 Writeln (' Sub-menu of New Request ');
 Writeln (' ------------------------');;
end; {of procedure}
2ème : la procédure dans laquelle je montre tous mes détails dans la blackscreen.
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
begin
 AssignFile (examinerFile, 'examiner.dat');
 Reset (examinerFile);
 AssignFile (Centrefile, 'centre.dat');
 Reset (centrefile);
 Ptr := 0;
 Writeln ('-Name-     -Centre Number-    -Centre Name-    -Number of scripts marked-');
 while not eof (examinerfile) and not eof (centrefile)
  do
   begin
   Ptr := Ptr + 1;
   Writeln ('');
   Read (examinerfile, examiner[ptr]);
   Read (centrefile, centre[ptr]);
   Writeln ('');
   Write (examiner[ptr].examinername,'           ',centre[ptr].centreno,'              ');
   Writeln (centre[ptr].centrename,'                  ',examiner[ptr].totalscripts);
  end;
 Readln;
 Closefile (examinerfile);
 Closefile (centrefile);
 Writeln ('');
 Writeln ('');
 Writeln (' Sub-menu of Examiner List ');
 Writeln (' -------------------------');
end;
Personne n'a une idée du problème ?

FX