Search found 381 matches

by Harrison Pratt
27 Sep 2022 15:03
Forum: Visual Prolog
Topic: Overview documentation and listBox index problem
Replies: 3
Views: 34

Re: Overview documentation and listBox index problem

Listbox, listbutton and listEdit all inherit from listControl so you can collect the selected strings from a mixed group of these type controls like this: predicates % FAIL if any control does not have a selected string tryGetSelectedStrings : (listControl* CtrlList) -> string* SS determ. clauses tr...
by Harrison Pratt
27 Sep 2022 14:20
Forum: Visual Prolog
Topic: Overview documentation and listBox index problem
Replies: 3
Views: 34

Re: Overview documentation and listBox index problem

Take a look at my guiControlSupport class to see some ways to access and manipulation listBox, listButton and listEdit controls. You can simply add the class files ( .cl, .i & .pro ) files to an appropriate package and inherit it into the implementation of your form or dialog like this extract f...
by Harrison Pratt
27 Jul 2022 14:06
Forum: Visual Prolog
Topic: Move from Prolog to Visual Prolog
Replies: 2
Views: 1215

Re: Move from Prolog to Visual Prolog

Something like the following should get you started. VP is a big leap from classic prolog, but VP has a lot of advantages, especially once your project becomes complex. The code below is for a console application, so all you need to do is invoke ask/0 from your main application code. class predicate...
by Harrison Pratt
8 Jul 2022 10:55
Forum: Visual Prolog
Topic: Execute a predicate stored in a clause (or fact)
Replies: 3
Views: 886

Re: Execute a predicate stored in a clause (or fact)

Thanks!

The sound you hear is me doing a "face-palm"! :D
by Harrison Pratt
7 Jul 2022 21:24
Forum: Visual Prolog
Topic: Execute a predicate stored in a clause (or fact)
Replies: 3
Views: 886

Execute a predicate stored in a clause (or fact)

I was thinking about ways to reduce code complexity in some menu functions and I seem to recall that it might be possible to store menu actions in a clause (or fact) structure, something like this: class predicates doAction : (integer SelectionIndex, predicate ExecuteSelection [out]) determ. clauses...
by Harrison Pratt
25 Jun 2022 15:45
Forum: Visual Prolog
Topic: Sort a List of Functors
Replies: 7
Views: 1795

Re: Sort a List of Functors

Here's an example you can test for yourself as a console application. domains pTerm = p(integer, integer, integer, integer). clauses run() :- PTerms = [p(1, 2, 3, 4), p(3, 2, 1, 0), p(6, 3, 1, 2), p(2, 5, 7, 8)], ValueN = { (Index, P) = I :- p(A, B, C, D) = P, I = list::nth(Index, [A, B, C, D]) }, P...
by Harrison Pratt
12 Jun 2022 14:04
Forum: Visual Prolog
Topic: Filtering the needed facts of very large internal database files
Replies: 6
Views: 1719

Re: Filtering the needed facts of very large internal database files

Have you considered writing a tiny tool in Vip10 just to do the data allocation so you can continue to use your Vip7.5 application? It would be a "safe" and easy way to get up to speed on Vip10. The conversion of your 7.5 legacy app(s) in their entirety could be tedious.
by Harrison Pratt
11 Jun 2022 10:54
Forum: Visual Prolog
Topic: Filtering the needed facts of very large internal database files
Replies: 6
Views: 1719

Re: Filtering the needed facts of very large internal database files

If the data on disk is already in the form of VIP prolog facts, you can do something like the below to assert facts into different databases (if those facts have different structures). class facts - myDataDB myData : (string). class facts - yourDataDB yourData : (integer). clauses run() :- MyS = &qu...
by Harrison Pratt
10 Jun 2022 21:10
Forum: Visual Prolog
Topic: Filtering the needed facts of very large internal database files
Replies: 6
Views: 1719

Re: Filtering the needed facts of very large internal database files

Maybe something like this? class facts myData : (string). class predicates readProductTerms : (string InFile, string ProductCode). clauses readProductTerms(InFile, ProductCode) :- Input = inputStream_file::openFile8(InFile), SearchCode = string::format(string::format(",\"%\",", P...
by Harrison Pratt
8 May 2022 15:11
Forum: Visual Prolog
Topic: Tooltip editing disabled in IDE ?
Replies: 1
Views: 31476

Tooltip editing disabled in IDE ?

Is toolTip editing permanently disabled in the IDE resource editor? It was possible to edit toolTip text in previous VP versions. Screenshot 2022-05-08 100451.png Of course, tooltips can be created in the constructor: new( Parent ):- ... generatedInitialize(), pushButton_ctl_CANCEL:tooltipText := to...
by Harrison Pratt
7 Apr 2022 2:35
Forum: Visual Prolog
Topic: changing a listBox attribute?
Replies: 5
Views: 4957

Re: changing a listBox attribute?

I deal with this issue by using two different constructors for the dialog, one for multiple selection and another for single selection. For example: newMulti(Parent) :- dialog::new(Parent), generatedInitialize(), listbox_ctl:addList(["one", "two", "three"]), listbox_ctl...
by Harrison Pratt
28 Mar 2022 12:34
Forum: Visual Prolog
Topic: Antivirus issue with
Replies: 2
Views: 6421

Re: Antivirus issue with

Thanks for the info, Thomas.

In the past, McAfee has been associated with major file corruption/loss for me when using OneDrive and I won't ever use it again.
by Harrison Pratt
26 Mar 2022 22:27
Forum: Visual Prolog
Topic: Antivirus issue with
Replies: 2
Views: 6421

Antivirus issue with

I sent an small Vip10x application with the EXE and associated DLL files to a friend and it was flagged and (?) quarantined by McAfee.

It looks like McAfee reduced the size of the EXE on his system, too.
Is this a known problem?
by Harrison Pratt
19 Mar 2022 14:19
Forum: Visual Prolog Tips & Samples
Topic: xyChartDemo - GDIPLUS XY graphing demonstration
Replies: 5
Views: 14299

Re: xyChartDemo - GDIPLUS XY graphing demonstration

Attached is a trivial upgrade of xyChartDemo for Vip10x.
There are no changes other than tidying it up for 10x.
by Harrison Pratt
28 Feb 2022 17:18
Forum: Visual Prolog Tips & Samples
Topic: ~ CalmoSoft Fifteen Puzzle Game ~
Replies: 21
Views: 178757

Re: ~ CalmoSoft Fifteen Puzzle Game ~

I tried the game some time ago; it works as intended (I guess).

It might be more interesting as an algorithmic teaching tool if the program could give some feedback on game strategy as the user makes moves during the game.