Unable to save state.

This is a discussion on Unable to save state. within the PROLOG forums in Programming Languages category; 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). ...

Go Back   Application Development Forum > Programming Languages > PROLOG

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-22-2008, 06:23 PM
phi500ac@yahoo.ca
Guest
 
Default Unable to save state.

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).

Reply With Quote
  #2  
Old 07-23-2008, 08:38 AM
Jan Wielemaker
Guest
 
Default Re: Unable to save state.

On 2008-07-22, phi500ac@yahoo.ca <phi500ac@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(Mrolog_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


>
>
> ?- 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).
>

Reply With Quote
  #3  
Old 07-23-2008, 11:48 AM
phi500ac@yahoo.ca
Guest
 
Default Re: Unable to save state.

On 23 jul, 09:38, Jan Wielemaker <j...@nospam.ct.xs4all.nl> wrote:
> On 2008-07-22, phi50...@yahoo.ca <phi50...@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(Mrolog_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
>
>
>
> > ?- 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).


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.
Reply With Quote
  #4  
Old 08-01-2008, 07:50 AM
Jan Wielemaker
Guest
 
Default Re: Unable to save state.

On 2008-07-23, phi500ac@yahoo.ca <phi500ac@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
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:51 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.