Search found 407 matches
- 12 May 2023 21:02
- Forum: Visual Prolog
- Topic: Working with Integers
- Replies: 3
- Views: 142
Re: Working with Integers
Take a look at the list class for lots of useful predicates. For example, you can retrieve the "nth" element of a list this way: AttributeList = [1, 2, 3, 4, 5], Attribute1 = list::nth(0, II), % <== note that list indices are 0-based % returns Attribute1 = 1 If you are at all uncertain abo...
- 12 May 2023 15:16
- Forum: Visual Prolog
- Topic: de Boer's Beginners' Guide, section 6.4, help please...
- Replies: 4
- Views: 156
Re: de Boer's Beginners' Guide, section 6.4, help please...
I think you found a typographic error. This makes more sense:
Code: Select all
grandfather(Person, Grandfather) :-
% parent(Father, ParentOfPerson), % <== error
parent(Person, ParentOfPerson),
father(ParentOfPerson, GrandFather).
- 13 Mar 2023 14:18
- Forum: Visual Prolog
- Topic: Date time and hour
- Replies: 5
- Views: 393
Re: Date time and hour
Thanks! 

- 12 Mar 2023 18:01
- Forum: Visual Prolog
- Topic: Date time and hour
- Replies: 5
- Views: 393
Re: Date time and hour
This code snippet should do it for you. On dialog creation you can start a timer with the interval you want, e.g. 1000 milliseconds. Store the timer's handle in a static fact. Use the IDE to create an onTimer/2 event that is invoked whenever the timer passes the threshold. Update the time display in...
- 11 Mar 2023 14:57
- Forum: Visual Prolog
- Topic: Date time and hour
- Replies: 5
- Views: 393
Re: Date time and hour
How to get formatted time: clauses run() :- Tnow = time::now(), TimeStamp = Tnow:formatDateTime("dd-MM-yyyy", " HH:mm:ss"), stdio::write("\nTime now: ", TimeStamp), _ = console::readLine(). It's up to you to determine if, how often and how you want to update the text bo...
- 9 Mar 2023 13:38
- Forum: Visual Prolog
- Topic: Code Improvement
- Replies: 2
- Views: 235
Re: Code Improvement
Take a look at the attached files. I think a better strategy that you could use would be to do the following: Treat all the signs and symptoms as generic "observations" Put the observations into a consultable fact file (not hard-coded as in test.pro Make disease diagnosis contingent upon f...
- 8 Mar 2023 14:22
- Forum: Visual Prolog
- Topic: Code Improvement
- Replies: 2
- Views: 235
Re: Code Improvement
Your code appears to be functionally incomplete. For example, xpositive/2 and xnegative/2 are asserted but not used and the run/0 clauses don't work like I think they ought to. As a starting point, I would suggest that you try the following: Specify your own domains to make your code easier to follo...
- 16 Feb 2023 13:04
- Forum: Visual Prolog Tips & Samples
- Topic: PropertyDepot - property code generator and repository
- Replies: 6
- Views: 559
Re: PropertyDepot - property code generator and repository
Fixed it. I neglected to consider empty string when checking for unquoted string value.
myString : string should generate myString_fact : string := erroneous. and supporting clauses.
Thanks.
myString : string should generate myString_fact : string := erroneous. and supporting clauses.
Thanks.
- 15 Feb 2023 14:50
- Forum: Visual Prolog Tips & Samples
- Topic: PropertyDepot - property code generator and repository
- Replies: 6
- Views: 559
Re: PropertyDepot - property code generator and repository
Updated properties_PACKAGE folder attached as ZIP file.
Attachment deleted. Use the package in the 16 February 2023 post below.
Attachment deleted. Use the package in the 16 February 2023 post below.
- 14 Feb 2023 14:58
- Forum: Visual Prolog Tips & Samples
- Topic: PropertyDepot - property code generator and repository
- Replies: 6
- Views: 559
Re: PropertyDepot - property code generator and repository
Thanks for the sciLexer update -- that's much better. I realize that autoFormat will change the layout. I laid out the generated code to be easy to read in the generated-code dialog. About the string problem, did you not quote the string value or did you see different kind of error? There is a speci...
- 14 Feb 2023 13:51
- Forum: Visual Prolog
- Topic: Another feature suggestion
- Replies: 4
- Views: 336
Re: Another feature suggestion
Thanks ... it seems I've been under-thinking this. 

- 13 Feb 2023 17:28
- Forum: Visual Prolog
- Topic: Another feature suggestion
- Replies: 4
- Views: 336
Another feature suggestion
After having explored PropertyDepot ideas, it seems that a nice feature for VP would be a compiler directive that could automatically insert the property getters and setters into the implementation file. That would make a database of properties less important. Maybe something like this: interface my...
- 12 Feb 2023 18:38
- Forum: Visual Prolog Tips & Samples
- Topic: PropertyDepot - property code generator and repository
- Replies: 6
- Views: 559
Re: PropertyDepot - property code generator and repository
PropertyDepot is updated as follows: Domains may be prefixed with '::' propColor : ::color Parameter labels are allowed myTerm : trm( string ID, real Value ) myRect : vpiDomains::rct( integer X, integer Y, integer Right, integer Bottom ) Tuple definitions are supported, as is star-list syntax propT...
- 26 Nov 2022 14:27
- Forum: Visual Prolog Tips & Samples
- Topic: PropertyDepot - property code generator and repository
- Replies: 6
- Views: 559
PropertyDepot - property code generator and repository
Ever get annoyed by all the code you have to type to support properties ... and then you need to make a few changes and have to reorganize it all? Yeah, me too! PropertyDepot is will let you maintain a database of your own sets of properties and generate property or single fact code that you can pas...
- 24 Nov 2022 13:02
- Forum: Visual Prolog
- Topic: Tiny feature suggestion for next VP version
- Replies: 3
- Views: 523
Re: Tiny feature suggestion for next VP version
The predicate inc() would be useful when calculating running means, so I guess it does make sense to keep the interface for varM_real the same as that of varM_integer.