Create a file on magnetic tape: Difference between revisions

no edit summary
No edit summary
Line 109:
f.writeln("Hello World!");
}</lang>
=={{header|Delphi}}==
{{Trans|D}}
<lang Delphi>
program Create_a_file_on_magnetic_tape;
 
{$APPTYPE CONSOLE}
 
const
{$IFDEF WIN32}
FileName = 'tape.file';
{$ELSE}
FileName = '/dev/tape';
{$ENDIF}
 
var
f: TextFile;
 
begin
Assign(f, FileName);
Rewrite(f);
Writeln(f, 'Hello World');
close(f);
end.
</lang>
=={{header|Fortran}}==
Fortran performs reads and writes to some device, without caring much about the precise nature of the device: card reader/punch, paper tape reader/punch, keyboard, display console, and of course magnetic tape. Sequential input or output is normal, but random access by record number is also possible, though the interface between the Fortran program and the device may not support such attempts, as with a card reader or a display screen. There are also special statements, such as REWIND and BACKSPACE, and ENDFILE. The file OPEN statement will specify such matters as record length and block size and so all is in place for dealing with magnetic tapes...
478

edits