Pascal で外部ファイルに書き込むと、コーディングに問題はありませんが、外部ファイルが完全には書き込まれません。
procedure save;
{Menyimpan data penerbangan ke dalam file eksternal}
begin
write('> ');
write('nama file: ');
readln(namafisik);
assign(d,namafisik);
{$I-};
rewrite(d);
{$I+};
if (IOresult=0) then
begin
for i:=1 to Neff do
writejadwal(i);
end;
end;
procedure writejadwal(i:integer);
{Menuliskan jadwal ke file eksternal pada indeks ke-i}
begin
write(d,T.KodePenerbangan[i]);
write(d,' | ');
write(d,T.KotaKeberangkatan[i]);
write(d,' | ');
write(d,T.KotaKedatangan[i]);
write(d,' | ');
if ((T.TKeberangkatan[i].Day) < 10 ) then
begin
x:=T.TKeberangkatan[i].Day;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKeberangkatan[i].Day);
end;
write(d,':');
if ((T.TKeberangkatan[i].Month) < 10 ) then
begin
x:=T.TKeberangkatan[i].Month;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatan[i].Month);
end;
write(d,':');
write(d,T.TKeberangkatan[i].Year);
write(d,' | ');
if ((T.TKeberangkatan[i].Hour) < 10 ) then
begin
x:=T.TKeberangkatan[i].Hour;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatan[i].Hour);
end;
write(d,':');
if ((T.TKeberangkatan[i].Minute) < 10 ) then
begin
x:=T.TKeberangkatan[i].Minute;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatan[i].Minute);
end;
write(d,' | ');
if ((T.TKedatangan[i].Day) < 10 ) then
begin
x:=T.TKedatangan[i].Day;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKedatangan[i].Day);
end;
write(d,':');
if ((T.TKedatangan[i].Month) < 10 ) then
begin
x:=T.TKedatangan[i].Month;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKedatangan[i].Month);
end;
write(d,':');
write(d,T.TKedatangan[i].Year);
write(d,' | ');
if ((T.TKedatangan[i].Hour) < 10 ) then
begin
x:=T.TKedatangan[i].Hour;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKedatangan[i].Hour);
end;
write(d,':');
if ((T.TKedatangan[i].Minute) < 10 ) then
begin
x:=T.TKedatangan[i].Minute;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKedatangan[i].Minute);
end;
write(d,' | ');
if (T.TKedatanganImplementasi[i].Day=0) then
writeln(d,'__:__:____ | __:__ | __:__:____ | __:__')
else
{MULAI}
begin
if ((T.TKeberangkatanImplementasi[i].Day) < 10 ) then
begin
x:=T.TKeberangkatanImplementasi[i].Day;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKeberangkatanImplementasi[i].Day);
end;
write(d,':');
if ((T.TKeberangkatanImplementasi[i].Month) < 10 ) then
begin
x:=T.TKeberangkatanImplementasi[i].Month;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatanImplementasi[i].Month);
end;
write(d,':');
write(d,T.TKeberangkatanImplementasi[i].Year);
write(d,' | ');
if ((T.TKeberangkatanImplementasi[i].Hour) < 10 ) then
begin
x:=T.TKeberangkatanImplementasi[i].Hour;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatanImplementasi[i].Hour);
end;
write(d,':');
if ((T.TKeberangkatanImplementasi[i].Minute) < 10 ) then
begin
x:=T.TKeberangkatanImplementasi[i].Minute;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKeberangkatanImplementasi[i].Minute);
end;
write(d,' | ');
if ((T.TKedatanganImplementasi[i].Day) < 10 ) then
begin
x:=T.TKedatanganImplementasi[i].Day;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKedatanganImplementasi[i].Day);
end;
write(d,':');
if ((T.TKedatanganImplementasi[i].Month) < 10 ) then
begin
x:=T.TKedatanganImplementasi[i].Month;
str(x,y);
s:=y;
write(d,'0'+s);
end
else
begin
write(d,T.TKedatanganImplementasi[i].Month);
end;
write(d,':');
write(d,T.TKedatanganImplementasi[i].Year);
write(d,' | ');
if ((T.TKedatanganImplementasi[i].Hour) < 10 ) then
begin
x:=T.TKedatanganImplementasi[i].Hour;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKedatanganImplementasi[i].Hour);
end;
write(d,':');
if ((T.TKedatanganImplementasi[i].Minute) < 10 ) then
begin
x:=T.TKedatanganImplementasi[i].Minute;
str(x,y);
write(d,'0'+y);
end
else
begin
write(d,T.TKedatanganImplementasi[i].Minute);
end;
writeln(d);
end;
{SELESAI}
end;
ちなみにjadwalは英語のインドネシア語