FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log inLog in 


family1 example

Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog
View previous topic :: View next topic  
Author Message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 10 Oct 2017 22:39    Post subject: family1 example Reply with quote

family1 does not produce the result that is indicated in the tutorial.
_________________
GDFBSN
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 11 Oct 2017 8:36    Post subject: Reply with quote

I get exactly the same result as in the tutorial, so you will have to provide more details.
_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 11 Oct 2017 17:07    Post subject: Reply with quote

I am using the Personal Edition of Visual PROLOG 8. I copied and pasted the exact code in the tutorial and then created the fa.txt file and added it. I am running it in Console Mode. I get a lot of DOS gibberish and then a PAUSE which if answered terminates the application.
_________________
GDFBSN
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 12 Oct 2017 11:03    Post subject: Reply with quote

Please show me the "DOS gibberish".
_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 12 Oct 2017 15:13    Post subject: Reply with quote

I can't copy the DOS gibberish. It's DOS.
What it looks like is the program is having trouble opening the fa.txt file. I created this file with NOTEPAD. I performed the FILE/ADD. Where should the file be located to facilitate getting it opened?

_________________
GDFBSN
Back to top
View user's profile Send private message
Harrison Pratt



Des Moines, Iowa USA
Joined: 05 Nov 2000
Posts: 312

PostPosted: 12 Oct 2017 16:45    Post subject: Reply with quote

Can you send a screenshot using this technique?

https://www.howtogeek.com/226280/how-to-take-screenshots-in-windows-10/
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 12 Oct 2017 21:05    Post subject: Reply with quote

Before doing what I suggest below, please attach fa.txt here; I am curious about its format.

Secondly, try dropping the file on the IDE, so that it will open in our editor. If that works then make a change and save it again. That will change the file to utf-8 with an utf-8 byte-order-mark.

_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 13 Oct 2017 18:36    Post subject: Reply with quote

I will try what you suggest.

Thanks for your help Very Happy



fa.txt
 Description:
Here is the fa.txt file and where it was located.

Download
 Filename:  fa.txt
 Filesize:  201 Bytes
 Downloaded:  3 Time(s)


_________________
GDFBSN
Back to top
View user's profile Send private message
Harrison Pratt



Des Moines, Iowa USA
Joined: 05 Nov 2000
Posts: 312

PostPosted: 13 Oct 2017 22:15    Post subject: Reply with quote

Try removing all the leading spaces before the facts.

Change the file from this:

clauses
    person("Judith",female).
    person("Bill",male).
    person("John",male).
    person("Pam",female).
    parent("John","Judith").
    parent("Bill","John").
    parent("Pam","Bill").

To this:

clauses
person("Judith",female).
person("Bill",male).
person("John",male).
person("Pam",female).
parent("John","Judith").
parent("Bill","John").
parent("Pam","Bill").

Back to top
View user's profile Send private message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 13 Oct 2017 22:20    Post subject: Reply with quote

Here is a screenshot. . . .


Screenshot (1).png
 Description:
Screenshot
 Filesize:  99.62 KB
 Viewed:  55 Time(s)

Screenshot (1).png



_________________
GDFBSN
Back to top
View user's profile Send private message
Harrison Pratt



Des Moines, Iowa USA
Joined: 05 Nov 2000
Posts: 312

PostPosted: 14 Oct 2017 12:09    Post subject: Reply with quote

Make sure that you have saved the fa.txt file in the family1 subdirectory, not in the EXE directory. The error message indicates that the file is not found where specified.

reconsult("..\\fa.txt"),  % leading "..\\" refers to the parent directory of the location where the family1.exe file is located.

Regarding my earlier comment about leading spaces. Testing the project in VIP 7.5 shows that leading spaces do NOT cause a problem when consulting a data file.

When I tested this project I added a line to the last run clause to pause the display:

        run():-
            stdIO::write("End of test\n"),
            % NOTE: code below to pause output
            _ = stdio::readLine().

Back to top
View user's profile Send private message
fviskovi



United States
Joined: 10 Oct 2017
Posts: 6

PostPosted: 14 Oct 2017 18:58    Post subject: Reply with quote

My problem is fixed. The example ran as it should. The move of the fa.txt file did the trick. I did not remove the leading spaces but it was stated that this shouldn't have mattered anyway.

Thanks everyone for their time, patience, and assistance. I appreciate it!!! Have a great weekend!!! Cool

Very Happy

_________________
GDFBSN
Back to top
View user's profile Send private message
Thomas Linder Puls



Copenhagen, Denmark
Joined: 28 Feb 2000
Posts: 3124

PostPosted: 16 Oct 2017 18:52    Post subject: Reply with quote

Notice that the "DOS gibberish" describe the problem quite precisely:
Quote:
Cannot create or open '..\fa.txt'
Error = 00000002
The system cannot find the file specified


_________________
Regards Thomas Linder Puls
Prolog Development Center
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    discuss.visual-prolog.com Forum Index -> Visual Prolog All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum