Subject: Re: Building runtimes on WinNT 4

From: Lionel Ains <[email-masked]>
Date: Tue, 8 Aug 2000 16:15:18 +0100 (WET DST)

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=go, toplevel=none, stand_alone=true]), 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=go, toplevel=none, 
stand_alone=true]), 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=true 
option).
The other options are:
toplevel=none. I don't need a toplevel goal because I run the program by putting the main program's 
predicate in the goal= options.
goal=go 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= 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" <[email-masked]>
> 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:[email-masked]]
> Sent: Tuesday, August 08, 2000 3:16 PM
> To: Paul Holmes-Higgin; [email-masked]
> 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=go, toplevel=none, stand_alone=true]),
> write('Program successfully
> saved'), nl" -t halt.

______________________________________________________
Boîte aux lettres - Caramail - http://www.caramail.com