Languages :: Pascal :: i'm trying to write to a text file but it doesn't work |
|||
| By: TheFalklands |
Date: 03/09/2003 00:00:00 |
Points: 20 | Status: Answered Quality : Excellent |
|
I'm trying to write directly (without passing by constant or variables) to a text file named "WORKER.TXT" that's my code PROGRAM Programming_Practice_5; VAR worker:text; BEGIN assign(worker, 'WORKER.TXT'); rewrite(worker); WriteLn(worker, 'Summary Houres Done By;'); WriteLn(worker, '-----------------------'); END. could anyone try to find the cause(s) ??? thanks in advance The_Beatle |
|||
| By: VGR | Date: 03/09/2003 17:29:00 | Type : Answer |
|
| the cause(s) of WHAT ? :D is there any error ? (à part from the textfile being not flushed nor clsoed, of course ;-)) this is perfectly valid : PROGRAM Programming_Practice_5; VAR worker : text; { NB this has become TextFile afterwards } BEGIN assign(worker, 'WORKER.TXT'); rewrite(worker); WriteLn(worker, 'Summary Houres Done By;'); WriteLn(worker, '-----------------------'); close(worker); { flush is implicit when closing } END. |
|||
| By: TheFalklands | Date: 03/09/2003 17:30:00 | Type : Comment |
|
| thanks it's working now thank you very much the_beatle |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








