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} |
Partager