🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.borland
Article #685

Re: Writing to text Files

#685
From: Konstantin Koll
Date: Sun, 06 Jun 1999 00:00
25 lines
1421 bytes
Ali wrote:
> 
> Could some one show me a quick little,simple source code to writing to text
> files, i've tries to write to a text file but i get an error: File not open
> for output (run time error, i think error no: 105). THis is how i try to
> write to text files:
> var
>     f:text;
>     c:char;
> begin
>     read(c);
>     assign(f,'fdsat.txt');
>     reset(f);
>     Write(f,c);
> End.

As written above, RESET is only for reading files; writing files must be done
with REWRITE.
However, it's vital for your program to use close(f); at the end; otherwise the
last part
of your text may remain in the internal cache of that file (size is 128 byes
AFAIK), and never
be written to disk.

Regards, Konstantin Koll
Technical Details
Message-ID: <375A766A.34C07F9B@ls3.cs.uni-dortmund.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7jaola$r31$1@news5.svr.pol.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 110467,863a3507bf12c2da
X-Google-Attributes: gid110467,public
X-Google-Thread: 111659,863a3507bf12c2da
X-Google-Attributes: gid111659,public
From: Konstantin Koll <koll@ls3.cs.uni-dortmund.de>
Subject: Re: Writing to text Files
Date: 1999/06/06
Message-ID: <375A766A.34C07F9B@ls3.cs.uni-dortmund.de>
X-Deja-AN: 486305261
Content-Transfer-Encoding: 7bit
References: <7jaola$r31$1@news5.svr.pol.co.uk>
Content-Type: text/plain; charset=us-ascii
Organization: University Dortmund, Germany
Mime-Version: 1.0
Reply-To: kokoll00@marvin.cs.uni-dortmund.de
Newsgroups: comp.lang.pascal.borland,fido.ger.pascal