From jan@swi.psy.uva.nl Wed Feb 28 19:25:52 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1SIPqZ10092;
	Wed, 28 Feb 2001 19:25:52 +0100 (MET)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id TAA17120;
	Wed, 28 Feb 2001 19:25:52 +0100
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: Paul Singleton <p.singleton@keele.ac.uk>,
   SWI Prolog <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] Newbie question
Date: Wed, 28 Feb 2001 19:22:34 +0100
X-Mailer: KMail [version 1.0.28]
Content-Type: text/plain
References: <3A9D3FF8.FA23BFCC@keele.ac.uk>
In-Reply-To: <3A9D3FF8.FA23BFCC@keele.ac.uk>
MIME-Version: 1.0
Message-Id: <01022819255100.17039@gollem>
Content-Transfer-Encoding: 8bit

On Wed, 28 Feb 2001, Paul Singleton wrote:
>Jan Wielemaker wrote:
>
>> On Wed, 28 Feb 2001, Joćo Mariz wrote:
>> >
>> >Is there a way of sending those warnnings that may appear when we
>> >download a file with consult/1 predicate, to a file on the hard-disk?
>> >...
>
>> Depends a bit what you want.  If you simply want to store the session
>> for later reference, use protocol/1.  If you want to redirect the
>> error stream in general, you can do:
>> 
>>         open(myfile, write, Stream),
>>         set_stream(Stream, alias(user_error)),
>>         ...
>
>I'm calling LIBPL.DLL from a Visual Basic program (or object); could I
>set up a socket between VB and Prolog, and send user_output and user_error
>to VB?

I think that will work.  You can also create your own stream using the
C primitives and use the set_stream/2 to rebind the standard streams or
you can do what plwin.exe does: get the function-pointers of the
standard I/O streams and replace them by your own I/O routines.
See pl-ntmain.c for details.

	--- Jan

