From jdjohnston2@juno.com Sat Sep 29 01:12:41 2001
Received: from m7.jersey.juno.com (m7.jersey.juno.com [64.136.16.70])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f8SNCev07559
	for <prolog@swi.psy.uva.nl>; Sat, 29 Sep 2001 01:12:40 +0200 (MET DST)
Received: from cookie.juno.com by cookie.juno.com for <"agNVsrKwtOEeaIQ2GG4oqo8D8M1UX7//EuECWuVTwjuG4560RgZ0ag==">
Received: (from jdjohnston2@juno.com)
 by m7.jersey.juno.com (queuemail) id GGF8GYZN; Fri, 28 Sep 2001 19:12:10 EDT
To: starred@tiscalinet.it
Cc: prolog@swi.psy.uva.nl
Date: Fri, 28 Sep 2001 19:15:21 -0400
Subject: Re: [SWIPL] fail to consult if I click on the file.
Message-ID: <20010928.191522.-430743.0.jdjohnston2@juno.com>
X-Mailer: Juno 5.0.33
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: Jonathan D Johnston <jdjohnston2@juno.com>

Hi, Armando & Jan. May I offer another diagnosis?

[Earlier e-mails reordered]
[Armando Stellato]
> Hi, I've installed SWI Prolog on Win 98SE and Win2000.
> On the first one, it automatically consults the files that I click 
> with the mouse.
> On win2000, it fails to consult saying: 'Impossible to find file
> "<PATH>\file" or one of its components, verify correctness of path 
> and availability of libraries'.

I get a very similar error message on Win98se if I try to execute a
DDE command and there is no DDE server for that command.

[Armando Stellato]
> This is the configuration associated to the pl files (for the
> operation consult):
[snip] 
> use DDE (checked)
[snip]
 
[Jan Wielemaker]
> Was the installation fine? I.e. did the installation error described
> here recently trick you?  If installation was fine, what exactly is
> registered with the filetype "Prolog Source", associated with .PL
> (or whatever you choose)?

As of SWI-Prolog 4.0.1 (couldn't say as far as the newer versions),
plwin does *not* automatically register itself as a DDE server.  In
order to use the context menu commands (consult & edit), plwin must
have been previously started & code executed to register itself as a
DDE server.  Therefore, I have the following code in my pl.ini: 

<Code>
:- dde_register_service(prolog(control, Message), do_msg(Message)).

do_msg(Msg) :- back_to_fwd(Msg,Msg1), atom_to_term(Msg1,T,_), call(T).

% Substitute a forward slash (/) for each backslash (\).
% Makes the path easier to work with within SWI-Prolog.
back_to_fwd([],[]).
back_to_fwd(Ain, Aout) :-
    sub_atom(Ain, Start, 1, Len, '\\'),
    sub_atom(Ain, 0, Start, _, Aleft),
    Rem is Start+1,
    sub_atom(Ain, Rem, Len, _, ArightIn),
    back_to_fwd(ArightIn, ArightOut),
    concat_atom([Aleft, ArightOut], '/', Aout).
back_to_fwd(A, A).
</Code>

Not the prettiest Prolog code, but it does the job.  With this in
place, it's easy to select multiple .pl files in Windows Explorer to
be used with one plwin listener.  Double-click on the first file,
which launches plwin, implicitly consults pl.ini (which registers
plwin as a DDE server), & consults the selected file (No DDE needed).
For any other .pl files, simply right-click on each & select 'consult'
from the context menu.

HTH,
Jonathan D Johnston
________________________________________________________________
GET INTERNET ACCESS FROM JUNO!
Juno offers FREE or PREMIUM Internet access for less!
Join Juno today!  For your FREE software, visit:
http://dl.www.juno.com/get/web/.

