Search found 303 matches

by Harrison Pratt
20 Apr 2018 22:03
Forum: Visual Prolog
Topic: Change variable value employing expression of same variable
Replies: 5
Views: 5744

Re: Change variable value employing expression of same variable

The essence of prolog and some other functional languages is that variables are immutable, so strictly speaking the answer is "no, you can't do that." However, there are ways to use fact variables or mutable variable classes/objects to achieve the same result. You can find mutable objects here in pf...
by Harrison Pratt
8 Apr 2018 23:08
Forum: Visual Prolog
Topic: compound domains as return values?
Replies: 2
Views: 4956

Re: compound domains as return values?

VIP 7 & 8 forbid naming domains and facts with the same name, unlike VIP 5x. This seems like an annoyance when you are upgrading your code and thinking from 5x, but it will save you debugging time in the future. This sort of approach works: class dateStore : dateStore open core end class dateStore i...
by Harrison Pratt
3 Apr 2018 22:23
Forum: Visual Prolog
Topic: Conflicting class & domain declarations: font
Replies: 2
Views: 3940

Conflicting class & domain declarations: font

This is a minor syntax question that I think I asked before, but can't find the response or question in this this forum. I have a class implementation with the following open declarations: open core, vpi, list open vpiDomains open gdiplus, gdiplus_native, font How can I keep predicate declarations f...
by Harrison Pratt
15 Mar 2018 3:34
Forum: Visual Prolog
Topic: e504 (Type incompatibility)
Replies: 4
Views: 4013

Re: e504 (Type incompatibility)

You need a double colon here: stdio::write(ReplaceSlist)
That won't cause e504, though.

Other than that, it compiles OK after changing facts to class facts and predicates to class predicates.

Did you leave something out of your example code?
by Harrison Pratt
11 Mar 2018 22:14
Forum: Visual Prolog
Topic: Toolbar question - set/modify listButton string options
Replies: 2
Views: 2431

Re: Toolbar question - set/modify listButton string options

Thanks for the very useful tip, Thomas! I can create everything I need from that. I didn't know that gui_native::getDlgItem/2 could be so useful. From MSDN (my underscoring): You can use the GetDlgItem function with any parent-child window pair , not just with dialog boxes. As long as the hDlg param...
by Harrison Pratt
9 Mar 2018 17:53
Forum: Visual Prolog
Topic: Toolbar question - set/modify listButton string options
Replies: 2
Views: 2431

Toolbar question - set/modify listButton string options

How can I dynamically or statically add strings to a toolbar listButton? The Create Project Item wizard creates a listButton with an empty list in ProjectToolbar.pro. It is possible to edit the generated code, but the list is regenerated as [] when the project is rebuilt -- and we are amply warned t...
by Harrison Pratt
7 Mar 2018 16:30
Forum: Visual Prolog
Topic: VIP 8 Debugger 'Unknown' object
Replies: 1
Views: 2133

VIP 8 Debugger 'Unknown' object

I encountered a situation in which the debugger cannot fully capture object information in some circumstances. If I run the following code testEAV() :- EAVDB = g_eavDB::new("SomeEav"), % creates a new database object EAVDB:put_eavInt("Entity", "Attrib", 99), EAVDB:put_eavStr("Entity", "Attrib1", "11...
by Harrison Pratt
6 Mar 2018 12:23
Forum: Visual Prolog
Topic: Fill a listbox
Replies: 6
Views: 2968

Re: Fill a listbox

If you have downloaded the Examples you can find some prototypic guidance in the listDemo project there. I've had to do a lot of plowing out here in Iowa! One of the agricultural implements I use is a grep tool (AstroGrep) that enables me to search the Examples for sample usage and see a adjacent fe...
by Harrison Pratt
6 Mar 2018 4:52
Forum: Visual Prolog
Topic: Fill a listbox
Replies: 6
Views: 2968

Re: Fill a listbox

The listbox and other controls are objects that you can populate, clear and otherwise modify like this: listbox_ctl_ACIVITYYEARS:clearAll(), listbox_ctl_ACIVITYYEARS:addList( YrStrList ), % YrStrList is a string_list of years here, for example listbox_ctl_ACIVITYYEARS:setFocus(). It helps if you hav...
by Harrison Pratt
3 Mar 2018 13:22
Forum: Visual Prolog
Topic: the operators rem and mod don't function correctly after 238 operand
Replies: 1
Views: 1976

Re: the operators rem and mod don't function correctly after 238 operand

If Modulo5 = 239 mod 5 fails it is because Modulo5 is already bound to a different value and you are asking if the mathematical expression gives the same result as is already bound to Modulo5.

Mod and rem are built-in functions.
by Harrison Pratt
2 Mar 2018 23:21
Forum: Visual Prolog
Topic: redefine logStream := outputStream_file::create("log.txt"), for many different files
Replies: 1
Views: 2132

Re: redefine logStream := outputStream_file::create("log.txt"), for many different files

The code below works as expected. It would be good practice to keep track of the output streams which need to be closed when you are finished so I put it a rudimentary way of doing that, too. class facts logStream : outputStream := erroneous. logStreamsToClose : outputStream* := []. class predicates...
by Harrison Pratt
2 Mar 2018 19:10
Forum: Visual Prolog
Topic: linker errors: symbol redefinition in file ...
Replies: 7
Views: 2977

Re: linker errors: symbol redefinition in file ...

I thought that monitor class log was something you created--I couldn't find it by grepping the Visual Prolog 8 installation directory and subdirectories. A few days ago I had a project (fortunately a small one for exploring VIP8) that was munged by invoking Optimal Set of Include Directories . To so...
by Harrison Pratt
2 Mar 2018 15:56
Forum: Visual Prolog
Topic: linker errors: symbol redefinition in file ...
Replies: 7
Views: 2977

Re: linker errors: symbol redefinition in file ...

Are you using 7.5 or 8.0 ?

What happens if you remove monitor class log from your project?
by Harrison Pratt
2 Mar 2018 13:31
Forum: Visual Prolog
Topic: linker errors: symbol redefinition in file ...
Replies: 7
Views: 2977

Re: linker errors: symbol redefinition in file ...

Yes, in both 7.5 and 8.01. What seems to work is to Remove from Project the offending package and add it back again after completely closing and reopening the IDE and rebuilding the project as much as possible. I remember that just closing/reopening the IDE helps, but only rarely. I don't know what ...