Search found 279 matches

by Martin Meyer
13 Oct 2019 16:19
Forum: Visual Prolog
Topic: Progress Bar status indicator
Replies: 37
Views: 13782

Re: Progress Bar status indicator

To put a code grab into the post, click the "Code display" button pic.jpg which will insert a BBCode tag pair template into the text. Then place your code via copy/paste between the tags. When you create a new project, VIP makes a copy of a default project template to start with. For GUI style proje...
by Martin Meyer
12 Oct 2019 23:15
Forum: Visual Prolog
Topic: List unification problem
Replies: 6
Views: 4019

Re: List unification problem

An example, which is obscure too, but cannot be de-obscured in same way as you have done above, is: open core class predicates test : (unsigned X). clauses test(X) :- tuple(A, X) = tuple(B, B), % throws errors: Variables "A", "B" are not completely bound stdIO::write(A, ", ", B). clauses run() :- te...
by Martin Meyer
12 Oct 2019 1:50
Forum: Visual Prolog
Topic: Progress Bar status indicator
Replies: 37
Views: 13782

Re: Progress Bar status indicator

I have found an easier solution. In a newly created GUI style project do as follows: Add the declaration for a predicate displayStatus/1 in projectToolbar.cl: class projectToolbar predicates create : (vpiDomains::windowHandle Parent). predicates displayStatus : (string Text). end class projectToolba...
by Martin Meyer
11 Oct 2019 23:02
Forum: Visual Prolog
Topic: List unification problem
Replies: 6
Views: 4019

Re: List unification problem

I have tried variations of my prior post , thereby I discovered it. I have even copied the wrong spelling 'unfiable' from there. :oops: Another example of notorious code, where unification has a problem (in build 902), is: open core clauses run() :- A = 1, tuple(tuple(A, A), tuple(B, B)) = tuple(B, ...
by Martin Meyer
10 Oct 2019 22:34
Forum: Visual Prolog
Topic: Progress Bar status indicator
Replies: 37
Views: 13782

Re: Progress Bar status indicator

...continued from previous post I add a timer listener in the task window: pic6.jpg I insert some code in the onTimer listener which will display the time in the text field of the new toolbar: pic7.jpg In the onShow listener I add a line to start a timer: pic8.jpg I run the project, voilà! pic9.jpg
by Martin Meyer
10 Oct 2019 22:29
Forum: Visual Prolog
Topic: Progress Bar status indicator
Replies: 37
Views: 13782

Re: Progress Bar status indicator

"Compile", "Rebuild All", etc. are displaying infos about what is currently going on at the bottom of VIP's main window. Analogously you want to display your own progress infos in a status line at the bottom of the application window. So your question is how to get texts to there. As said I am not v...
by Martin Meyer
9 Oct 2019 13:50
Forum: Visual Prolog
Topic: Progress Bar status indicator
Replies: 37
Views: 13782

Re: Progress Bar status indicator

I have no experiences with progress bars. But there is a demo for it named "progress" in the examples (which can be installed by "Help" / "Install Examples...").
by Martin Meyer
7 Oct 2019 17:52
Forum: Visual Prolog
Topic: List unification problem
Replies: 6
Views: 4019

List unification problem

Hello Thomas, please have a look at this code. It outputs "not unfiable" (in build 902). class predicates test : (unsigned*, unsigned*). clauses test(As, Bs) :- if [As, [X]] = [[X], Bs] then stdIO::write("unifies") else stdIO::write("not unfiable") end if. clauses run() :- test([1], [1]). P.S. Have ...
by Martin Meyer
14 Sep 2019 18:02
Forum: Visual Prolog
Topic: unsigned64 bit operations
Replies: 3
Views: 4913

unsigned64 bit operations

Hello Thomas, updating my code to the new bit operations I came upon a case with an unexpected result (in build 902): open bit class predicates getHighBitMask64_oldStyle : (unsigned64 X) -> unsigned64 Mask. clauses getHighBitMask64_oldStyle(X) = bitAnd(X_7, bitNot(bitRight(X_7, 1))) :- X_1 = bitOr(X...
by Martin Meyer
13 Sep 2019 17:00
Forum: Visual Prolog
Topic: convert unsigned 64
Replies: 5
Views: 3810

Re: convert unsigned 64

The result of predicate bit::getLow32of64/1-> has type unsigned . The value of an unsigned can be represented by an integer only if the value does not exceed the limits of the integer type. That is, convert(integer, U32 ) cannot work out when the value of the unsigned U32 is greater than upperBound(...
by Martin Meyer
7 Sep 2019 17:28
Forum: Visual Prolog
Topic: unsigned8 bit operations
Replies: 3
Views: 3288

Re: unsigned8 bit operations

Yes, there is a better way. Just make sure that ByteOut has domain unsigned8 : open core clauses run() :- hasDomain(unsigned8, Byte1), hasDomain(unsigned8, Byte2), Byte1 = 1 * 0x04 + 0 * 0x02 + 1 * 0x01, Byte2 = 1 * 0x04 + 1 * 0x02 + 0 * 0x01, hasDomain(unsigned8, ByteOut), ByteOut = Byte1 ^^ Byte2,...
by Martin Meyer
4 Sep 2019 0:37
Forum: Visual Prolog
Topic: Optional parameters
Replies: 1
Views: 2715

Optional parameters

Hello Thomas, in below call to enum/3 the last argument for an [out] parameter cannot (unintentionally?) be skipped (in VIP 902). domains unsigned3Enumerator = (unsigned A [out], unsigned B [out], unsigned C [out]) nondeterm. class predicates enum : unsigned3Enumerator. clauses enum(1, 2, 3). enum(4...
by Martin Meyer
5 Aug 2019 19:21
Forum: Visual Prolog
Topic: Otherwise operator with erroneous predicate
Replies: 2
Views: 2990

Re: Otherwise operator with erroneous predicate

Yes. Thank you for the detailed explanation.
by Martin Meyer
3 Aug 2019 12:19
Forum: Visual Prolog
Topic: Otherwise operator with erroneous predicate
Replies: 2
Views: 2990

Otherwise operator with erroneous predicate

Hello Thomas, please check this code (in build 902). The compiler refuses it (unintentionally?). But it compiles when the indicated line is outcommented: open core, exception constants myException : exception = exception(class_name(), constant_name(), "Error"). class predicates raise_myException : (...
by Martin Meyer
20 Jul 2019 14:29
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 4734

Re: Compiled clauses

Yes, there are save and consult predicates in VIP. They are not first language constructs but part of the PFC ("Prolog Foundation Classes"). The PFC comes with a help file. If you have installed Visual Prolog to folder "C:\Program Files (x86)\Visual Prolog 9 PE\" then the help file will be "C:\Progr...