Search found 19 matches

by dcgreenwood
18 Jun 2021 12:19
Forum: Visual Prolog
Topic: Importing a list
Replies: 2
Views: 36

Re: Importing a list

Thanks!
by dcgreenwood
17 Jun 2021 19:20
Forum: Visual Prolog
Topic: Importing a list
Replies: 2
Views: 36

Importing a list

I would like to be able to pull a long list of words from a file into a list. I know how to do that if each word is a fact, and I think I could do it by making a single fact with the long list of words delimited as a list in that fact, but is there a command that would allow a file with delimited wo...
by dcgreenwood
3 Jun 2021 2:47
Forum: Visual Prolog
Topic: Domains across classes?
Replies: 3
Views: 215

Re: Domains across classes?

I figured it out. My question was, how to use an interface to extend the scope of a domain For example, I have a project with the default class "main" In main.cl, I declare a domain location location = a20003; a2200; a2600. I create a package/class called "setup" In setup.i, I ch...
by dcgreenwood
1 Jun 2021 19:40
Forum: Visual Prolog
Topic: Domains across classes?
Replies: 3
Views: 215

Domains across classes?

I've been doing most of my project so far within main and the gui packages but am now trying to split main into separate packages to be more OO. However I can't figure out how to get my domains to work outside of the main class. I've read the tutorial but haven't found anything specifically addressi...
by dcgreenwood
22 May 2021 0:44
Forum: Visual Prolog
Topic: Call dialog from predicate?
Replies: 2
Views: 298

Call dialog from predicate?

I get that I can post dialogs/forms from a menu, and can manage my application by starting with a menu item, it runs until it stops/succeeds, then I can use another menu item to post a dialog to put in input and then run the program again with the same or different menu item. But can you post a dial...
by dcgreenwood
5 Apr 2021 22:52
Forum: Visual Prolog
Topic: making predicates procedures - single facts?
Replies: 1
Views: 442

making predicates procedures - single facts?

I keep running into the situation where I need a predicate or a stretch of code to be procedural, such as in a "for each do". I have a few databases of facts that are used as lookups (with many members) but then I also am using quite a few facts as ways to hold pieces of changeable informa...
by dcgreenwood
3 Apr 2021 13:43
Forum: Visual Prolog
Topic: How to approach fuzzy match
Replies: 3
Views: 538

Re: How to approach fuzzy match

Thanks, I'll use that!
by dcgreenwood
3 Apr 2021 1:59
Forum: Visual Prolog
Topic: How to approach fuzzy match
Replies: 3
Views: 538

How to approach fuzzy match

Is there a simple way using backtracking to find a match between a set of variables and a database of facts where the match may not be perfect? For example domains myDomain : good; bad ; ok. class facts myFactDB : (myDomain VarA, myDomain VarB, myDomain VarC, myDomain VarD). %assume I have a databas...
by dcgreenwood
1 Apr 2021 13:48
Forum: Visual Prolog
Topic: How to use file::save
Replies: 2
Views: 425

Re: How to use file::save

Thanks!
by dcgreenwood
1 Apr 2021 0:13
Forum: Visual Prolog
Topic: How to use file::save
Replies: 2
Views: 425

How to use file::save

I want to write a series of facts to a file, but I can't find any explanation about how to write facts to a file in any of the documentations. Only a few vague references that you can do it. Here is just a simple example of what I am trying to do class facts testDB : (string Name). class predicates ...
by dcgreenwood
27 Mar 2021 20:40
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 803

Re: writef not printing to Message Window

I now understand what was going on - I was completely wrong about the reason. What I did not realize was that the output to the Message Window is buffered and then written to the window only after the set of clauses terminates and returns to the window monitoring. I knew the clauses were executing (...
by dcgreenwood
27 Mar 2021 20:37
Forum: Visual Prolog
Topic: Predicate called from menu must be a procedure (?)?
Replies: 3
Views: 595

Re: Predicate called from menu must be a procedure (?)?

Thanks. The first option was perfect. I had not seen the use of OR this way before, I'm sure I will use one or all of these sequences again.
by dcgreenwood
27 Mar 2021 16:17
Forum: Visual Prolog
Topic: Predicate called from menu must be a procedure (?)?
Replies: 3
Views: 595

Predicate called from menu must be a procedure (?)?

I have a predicate runExperiment() being called from a menu. It seems that a predicate called from a menu item must be a procedure - anything else causes an error that I have not been able to resolve? Is this so? The predicates that start my program are (runExperiment is declared in main.cl as predi...
by dcgreenwood
24 Mar 2021 12:59
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 803

Re: writef not printing to Message Window

I figured out the problem, though I don't understand why it is a problem. Here is the problematic part class predicates checkFactionStatus : (faction Faction) nondeterm. startExperiment : () multi. checkIfExperimentOver : () multi. clauses % Experiment over is triggered by CheckIfExperimentOver fail...
by dcgreenwood
24 Mar 2021 2:33
Forum: Visual Prolog
Topic: writef not printing to Message Window
Replies: 6
Views: 803

writef not printing to Message Window

I'm running a gui program, with menu items calling clauses in Main. Two menu items trigger stdio::write that writes as normal to the Message Window. But another is supposed to, but its messages never appear. I've debugged it, and each write is being executed. It seems like maybe they are being direc...