visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: Pascal :: i'm trying to write to a text file but it doesn't work


By: TheFalklands U.S.A.  Date: 03/09/2003 00:00:00  English  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 English  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 English  Type : Comment
thanks it's working now
thank you very much

the_beatle

Do register to be able to answer

EContact
browser fav
page generated in 294.842000 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page