🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Writing to text Files

#686
From: wobble82
Date: Mon, 07 Jun 1999 00:00
39 lines
1461 bytes
ok ali,
here is a little simple code that writes 255 bytes into a file:

var    file: text;
        s : char;
        i :integer

begin
    assign(file,'c:\thefile-txt');
    rewrite(file);                            {use reset fi file's already
existing}
     c := x;
     for  i := 1 to 255
    begin
       write(file,c);
    end;
    close(file);

end.
is everything clear right now??

wob82

Ali schrieb in Nachricht <7jaola$r31$1@news5.svr.pol.co.uk>...
>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.
>
>
Technical Details
Message-ID: <7jhbvk$7cj$1@news.online.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: "wobble82" <wobble@online.de>
Subject: Re: Writing to text Files
Date: 1999/06/07
Message-ID: <7jhbvk$7cj$1@news.online.de>
X-Deja-AN: 486949131
References: <7jaola$r31$1@news5.svr.pol.co.uk>
X-Server-Date: 7 Jun 1999 21:01:40 GMT
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Organization: 1&1 Internet GmbH
Newsgroups: comp.lang.pascal.borland,fido.ger.pascal