From lains@caramail.com  Tue Aug  8 16:08:43 2000
Received: from mail.caramail.com (mail.caramail.com [195.68.99.70])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id QAA18990
	for <prolog@swi.psy.uva.nl>; Tue, 8 Aug 2000 16:08:37 +0200 (MET DST)
Received: from caramail.com (www28.caramail.com [195.68.99.48])
	by mail.caramail.com (8.8.8/8.8.8) with SMTP id QAA00725;
	Tue, 8 Aug 2000 16:15:18 +0100 (WET DST)
Date: Tue, 8 Aug 2000 16:15:18 +0100 (WET DST)
Posted-Date: Tue, 8 Aug 2000 16:15:18 +0100 (WET DST)
From: Lionel Ains <lains@caramail.com>
To: "Marcos Rebelo" <marcos@mind.pt>, prolog@swi.psy.uva.nl
Message-ID: <965747370026218@caramail.com>
X-Mailer: Caramail - www.caramail.com
Mime-Version: 1.0
Subject: Re: Building runtimes on WinNT 4
Content-Type: multipart/mixed; boundary="=_NextPart_Caramail_026218965747370_ID"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--=_NextPart_Caramail_026218965747370_ID
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

OK, here is the command-line:

 "C:\Program Files\SWI-Prolog\bin\plcon" -g "load_files(['prog']), write_ln('Program 
loaded'), qsave_program('prog.exe', [goal=3Dgo, toplevel=3Dnone, stand_alone=3Dtrue]), write_ln('Program 
Successfully saved')" -t halt.

Here is the explaination:
"C:\Program Files\SWI-Prolog\bin\plcon" is the name of the command-line executable version of 
SWI-Prolog. It's surrounded by double quotes because of the space in the directory name

The first parameter is the goal executed by Prolog (-g option).
The toplevel goal being "halt." (-t option), plcon will exit after executing the Prolog commands 
put inside the -g goal.

Here is the detail about the goal executed by plcon, that is to say, the followin Prolog call:
("load_files(['prog']), write_ln('Program loaded'), qsave_program('prog.exe', [goal=3Dgo, toplevel=3Dnone, 
stand_alone=3Dtrue]), write_ln('Program Successfully saved')

I give there a succession of Prolog predicate to execute (that's exactly the same as the user command 
inside from Prolog prompt).
First, I load the program in memory with consult ([program_name]).
Then, I write a "Program loaded" message.
I call qsave_program/2 predicate to create an executable (because of the stand_alone=3Dtrue 
option).
The other options are:
toplevel=3Dnone. I don't need a toplevel goal because I run the program by putting the main program's 
predicate in the goal=3D options.
goal=3Dgo means that go/0 will be called when the resulting executable file (the saved state) is loaded. 
That is the case if your program is started with
?- go
Otherwise, you have to adapt the name of the main goal (the goal=3D option) to your personal use.

After that, just print a message to check if qsave_program/2 succeeded.

When reading again this email, I start to think that I'm not clear at all...

I hope it will be enough,

Lionel

> -------Message d'origine-------
> De : "Marcos Rebelo" <marcos@mind.pt>
> Date : 08/08/100 14:50:27
> 
> I'm not Paul but i'm confused. Can you explan better the command you use
> please.
> Thanks
> MArcos
> 
> -----Original Message-----
> From: Lionel Ains [mailto:lains@caramail.com]
> Sent: Tuesday, August 08, 2000 3:16 PM
> To: Paul Holmes-Higgin; prolog@swi.psy.uva.nl
> Subject: Re: Building runtimes on WinNT 4
> 
> 
> Hello Paul,
> 
> here is the command line I use to build a stand-alone Prolog program with
> SWI 3.3.8:
> "C:\Program Files\SWI-Prolog\bin\plcon" -g "load_files(['prog']),
> write('Program loaded'), nl,
> qsave_program('prog.exe', [goal=3Dgo, toplevel=3Dnone, stand_alone=3Dtrue]),
> write('Program successfully
> saved'), nl" -t halt.

______________________________________________________
Bo=EEte aux lettres - Caramail - http://www.caramail.com


--=_NextPart_Caramail_026218965747370_ID--

