Subject: Re: [SWIPL] Newbie question

From: Jan Wielemaker <[email-masked]>
Date: Wed, 28 Feb 2001 19:22:34 +0100

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