Category : Pascal Source Code
Archive   : V_PASCAL.ZIP
Filename : FILEDEMO

 
Output of file : FILEDEMO contained in archive : V_PASCAL.ZIP
PROGRAM FILEDEMO; {a demonstration of reading from the terminal,}
{writing to a disk file, then reading the disk file to the screen.}
VAR
DISKFILE:TEXT;
S1:STRING;


BEGIN
WRITELN('filedemo demonstration program');
ASSIGN(DISKFILE,'file1'); {DISKFILE will have name 'file1'}
REWRITE(DISKFILE); {set it up for writing}
REPEAT
WRITE('line:'); {prompt for user input}
READLN(S1); {press F6 CR to enter an EOF}
WRITELN(DISKFILE,S1); {write to disk file}
UNTIL EOF(INPUT);
WRITELN;
RESET(DISKFILE); {now set up to read the disk file}
WHILE NOT EOF(DISKFILE) DO
BEGIN
READLN(DISKFILE,S1);
WRITELN(S1); {and copy it to the screen}
END;
WRITELN("that's all!");
END.



  3 Responses to “Category : Pascal Source Code
Archive   : V_PASCAL.ZIP
Filename : FILEDEMO

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/