| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| 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). |
|
#2
| |||
| |||
| 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(M rolog_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). > |
|
#3
| |||
| |||
| 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(M rolog_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. |
|
#4
| |||
| |||
| 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 |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.