Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unable to save state.

1 view
Skip to first unread message

phi5...@yahoo.ca

unread,
Jul 22, 2008, 6:23:24 PM7/22/08
to
I wrote a small program, and tried to save it on windows. The program
works fine, but it prints an anoying error message:

ERROR: import/1: prolog_file_type/2 is not declared public (still
imported)
Message: debug mode on


Does anyonw knows what is going on? I saved the program using the
following goal:


?- qsave_program('d:/pl/bin/drill.exe',
[ goal=ask_name,
toplevel=halt,
stand_alone=true]).


Here is the program:

%:- use_module(library(pce)).


ask_name :- nodebug,
new(@nom, dialog('Register')),
send(@nom, append,
new(NameItem, text_item(name))),
send(@nom, append,
new(Eval, text_item(evaluation))),
send(@nom, append,
button(ok, message(@nom, return,
NameItem?selection))),
send(@nom, append,
button(cancel, message(@nom, return, @nil))),
send(@nom, default_button, ok),
test(T,Gab),
%write(T),nl,
send(NameItem,value,T),
get(@nom, confirm, Rval),
%send(NameItem,clear),
checar(Rval,Gab, Eval).
ask_name :-
free(@nom).


test(crayon, pencil).
test(finir, end).
test(livre, book).

Jan Wielemaker

unread,
Jul 23, 2008, 8:38:51 AM7/23/08
to
On 2008-07-22, phi5...@yahoo.ca <phi5...@yahoo.ca> wrote:
> I wrote a small program, and tried to save it on windows. The program
> works fine, but it prints an anoying error message:
>
> ERROR: import/1: prolog_file_type/2 is not declared public (still
> imported)
> Message: debug mode on
>
>
> Does anyonw knows what is going on? I saved the program using the
> following goal:

No. Tried this on the latest version (Windows, I assume from the
filenames). Saved as mkexe.pl; opened by double clicking; ran the
save query and then started the result. No messages.

To debug this, see what the system knows about prolog_file_type/2 prior
to dumping, backtrack over results.

?- predicate_property(M:prolog_file_type(_,_), P).

You can also add map='map.txt' to the options to get a dump of the
contents of the saved state (don't send it here; only lines that
apply to prolog_file_type/2).

--- Jan

phi5...@yahoo.ca

unread,
Jul 23, 2008, 11:48:06 AM7/23/08
to
On 23 jul, 09:38, Jan Wielemaker <j...@nospam.ct.xs4all.nl> wrote:

Hi, Jan.
Thank you for answering my question. I also tried the program by
calling the plwin.exe interpreter. It works. It also works the way you
told me (clicking on the source file). However, I need to generate a
stand along exec file for my French classes. In order to generate the
exec file, it seems that one must use the qsave_program predicate, as
shown below.

?- qsave_program('d:/pl/bin/drill.exe',
[ goal=ask_name,
toplevel=halt,
stand_alone=true]).


The stand along executable file works perfectly well, i.e., it works
like the loaded code. However, it issues that error message that I
told you. You can check that for yourself. I believe that I need to
declare something related to prolog_file_type/2 predicate.

Jan Wielemaker

unread,
Aug 1, 2008, 7:50:01 AM8/1/08
to
On 2008-07-23, phi5...@yahoo.ca <phi5...@yahoo.ca> wrote:

> Thank you for answering my question. I also tried the program by
> calling the plwin.exe interpreter. It works. It also works the way you
> told me (clicking on the source file). However, I need to generate a
> stand along exec file for my French classes. In order to generate the
> exec file, it seems that one must use the qsave_program predicate, as
> shown below.
>
> ?- qsave_program('d:/pl/bin/drill.exe',
> [ goal=ask_name,
> toplevel=halt,
> stand_alone=true]).
>
>
> The stand along executable file works perfectly well, i.e., it works
> like the loaded code. However, it issues that error message that I
> told you. You can check that for yourself. I believe that I need to
> declare something related to prolog_file_type/2 predicate.

Turns out you get this error if you start plwin.exe, load a Prolog
file through the menu and then create a saved state. Fixed. A simple
work-around though is to open the file by double-clicking it in the
Windows explorer. That is much more comfortable anyway.

--- Jan

0 new messages