Turbo Prolog: Writing to a file? 
Author Message
 Turbo Prolog: Writing to a file?

Gday,

Just a very brief question.

Can someone please tell me how to write (for example "Hello") to a file in
Turbo prolog.  Preferably with a new line on the end.

Thank you.

Dave.

--                                       |          |
David Browne                             |          |
Bachelor of Computing (Honours) Student  |     __o  |_________________
Department of Software Development       |   _ \<,_ ` /   \ /   \

--



Mon, 14 Dec 1998 03:00:00 GMT  
 Turbo Prolog: Writing to a file?


Quote:

> Path:

news.pi.net!surfnet.nl!howland.reston.ans.net!swrinde!ihnp4.ucsd.edu!munnari.OZ
AU!news.unimelb.EDU.AU!news.rmit.EDU.AU!harbinger.cc.monash.edu.au!daveb
Quote:

> Newsgroups: comp.lang.prolog
> Subject: Turbo Prolog: Writing to a file?
> Date: 27 Jun 1996 05:39:09 GMT
> Organization: Monash University
> Lines: 18

> NNTP-Posting-Host: insect.sd.monash.edu.au
> X-Newsreader: TIN [version 1.2 PL2]

> Gday,

> Just a very brief question.

> Can someone please tell me how to write (for example "Hello") to a file in
> Turbo prolog.  Preferably with a new line on the end.

> Thank you.

> Dave.

> --                                       |          |
> David Browne                             |          |
> Bachelor of Computing (Honours) Student  |     __o  |_________________
> Department of Software Development       |   _ \<,_ ` /   \ /   \

> --

Not that difficult.

openwrite(yourfile,"yourfile.txt"),
writedevice(yourfile),
write("hello\n"),'
closefile(yourfile).

In the domain section of a turbo prolog program you need to declare:

file = yourfile.



Thu, 24 Dec 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Turbo Prolog write access to .WKS files

2. Interfacing Turbo Prolog to Turbo Pascal of Turbo C

3. MS-DOS palmtop games written in Turbo Prolog

4. Linking Turbo Prolog v2.0 with Turbo C

5. Turbo Prolog / Turbo C connecting problem

6. Porting Turbo Prolog programs to ISO Prolog

7. Syntex: Turbo Prolog and SWI-Prolog

8. Syntex: Turbo Prolog and SWI-Prolog

9. Learning prolog with Turbo Prolog

10. writing to a file in prolog

11. Writing to a file with ProLog

 

 
Powered by phpBB® Forum Software