Search found 302 matches

by Harrison Pratt
26 Aug 2019 11:56
Forum: Visual Prolog
Topic: Convert integer to hexadecimal
Replies: 4
Views: 322

Re: Convert integer to hexadecimal

string::format

Code: Select all

% Try this:         R = 12,         S = string::format("%1x", R),         stdio::write("\n", R, "\t", S), % S = "C"                
by Harrison Pratt
21 Aug 2019 12:25
Forum: Visual Prolog
Topic: Rename File
Replies: 2
Views: 365

Re: Rename File

See file:: move/2 and file::move/3 file::move/2 move : ( string Filename, string Destination). Moves file to another location. Description The predicate moves(renames) a file specified by Filename to the location, specified by Destination path. If Destination is a new file name, then the file will b...
by Harrison Pratt
16 Aug 2019 12:27
Forum: Visual Prolog
Topic: Undeclared Identifier
Replies: 3
Views: 435

Re: Undeclared Identifier

"My question is why did the error yesterday refer to the setRect line as setRect/5 when the code today only has 4 arguments?." Sometimes the dialog editor gets out of synch with the .pro file's automatically generated code after deleting some controls. If you get stuck in that error cycle just comme...
by Harrison Pratt
29 Jul 2019 15:52
Forum: Visual Prolog
Topic: DPC_WATCHDOG_VIOLATION [Solved]
Replies: 0
Views: 491

DPC_WATCHDOG_VIOLATION [Solved]

This is a too-long FYI tale of a one-time problem that is solved, but not understood. (VIP 8 Build 802, 32 bit application on Win10/64) PROBLEM: My PC began freezing when compiling a particular application and I had to power-off/on to regain control. It turns out that power cycling may been a mistak...
by Harrison Pratt
25 Jul 2019 20:12
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 861

Re: Compiled clauses

Nothing in VP prevents you from storing your facts in an encrypted form (e.g., as binary structures, scrambled strings, etc.) in an internal database which can be saved and consulted. This thread could have been much shorter had you told us in your original post that your concern was intellectual pr...
by Harrison Pratt
22 Jul 2019 15:01
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 861

Re: Compiled clauses

I have the same experience with 20,000+ facts in a consultable database. Speed optimization of database access via consult/2 should be deferred until it becomes an actual problem to be solved.
by Harrison Pratt
20 Jul 2019 14:43
Forum: Visual Prolog
Topic: Compiled clauses
Replies: 10
Views: 861

Re: Compiled clauses

Rangarajan, In most cases you should not need to resort to binary manipulations to read/write facts from/to disk storage. The consult/2 and save/2 predicates are remarkably fast. And, yes, you can save, for example, one set of database facts in one file, another set in another file and then consult ...
by Harrison Pratt
17 Jul 2019 13:15
Forum: Visual Prolog
Topic: display lines with numbers same length
Replies: 1
Views: 503

Re: display lines with numbers same length

See format in the string class.
by Harrison Pratt
10 May 2019 10:59
Forum: Visual Prolog
Topic: API reference
Replies: 3
Views: 802

Re: API reference

I wonder if this is pertinent to your issue: viewtopic.php?f=2&t=15729#p46710
by Harrison Pratt
1 May 2019 11:56
Forum: Visual Prolog
Topic: onKeyDown and window::defaultKeyDownHandling
Replies: 6
Views: 1059

Re: onKeyDown and window::defaultKeyDownHandling

Another approach is to use an edit control and set the Visible property to False. That control will accumulate the keys pressed, so you can either use that "history" or clear the edit control after each key press.
by Harrison Pratt
30 Apr 2019 20:47
Forum: Visual Prolog
Topic: onKeyDown and window::defaultKeyDownHandling
Replies: 6
Views: 1059

Re: onKeyDown and window::defaultKeyDownHandling

Controls capture the key actions before the form can act on them. If you delete all controls on the form which might capture a key press (including OK and Cancel buttons) then you can see that the form itself can capture the keystrokes. I haven't worked out how to handle having certain key actions b...
by Harrison Pratt
9 Apr 2019 13:54
Forum: Visual Prolog
Topic: onPaint/3 vs onMouseUp/4 event handling
Replies: 9
Views: 1220

Re: onPaint/3 vs onMouseUp/4 event handling

Thomas, thank you very much for looking into this.

I guess at this point it is sufficient to label this behavior "unfathomable" so that I can stop doubting my sanity. :D

Does this misbehavior also occur with VIP-9 ?
by Harrison Pratt
28 Mar 2019 15:22
Forum: Visual Prolog
Topic: onPaint/3 vs onMouseUp/4 event handling
Replies: 9
Views: 1220

Re: onPaint/3 vs onMouseUp/4 event handling

Here is a scenario that will raise the above exception with seeming healthy code: Build a 32 bit application with 64 bit IDE: the application executes OK. When I try to run with debugger I get a message asking to switch to 32 bit IDE. I accept the switch to 32 bit IDE. Run application without debugg...
by Harrison Pratt
26 Mar 2019 13:43
Forum: Visual Prolog
Topic: onPaint/3 vs onMouseUp/4 event handling
Replies: 9
Views: 1220

Re: onPaint/3 vs onMouseUp/4 event handling

I wonder if there is an inconsistency in building the application because the code below will either always work on one build or always raise an exception in another build. I force recompilation by just inserting a few spaces to the source .PRO file. It seems to occur randomly in 32 & 64 bit compila...