Search found 287 matches

by Harrison Pratt
9 Oct 2014 14:45
Forum: Visual Prolog
Topic: Technical problems on discussion forum and wiki
Replies: 7
Views: 2652

I hope you will be able to migrate what remains of the VIP 5.x forum topics, recalling that much was lost in a previous migration.
We are in a slow process of moving the discussion forum and the wiki to new hardware and update some of involved software.
by Harrison Pratt
8 Oct 2014 12:42
Forum: Visual Prolog
Topic: how to enter options in list box for user to select ..pls he
Replies: 2
Views: 1698

Re:

angel10 wrote:how to enter options in list box for user to select ..pls help i m new to visual prolog
Search the Help file for "List Box Controls" for an overview.

For more specific details and example code, search Help for "lbox_add" and follow the topics.
by Harrison Pratt
3 Aug 2014 12:28
Forum: Visual Prolog
Topic: Visual Prolog 7.5 Installation failed under Windows XP
Replies: 3
Views: 1934

Re: Visual Prolog 7.5 Installation failed under Windows XP

It installed for me without a hiccup on XP SP3.
Can we run the 7.5 Release under Windows XP SP3 ?
by Harrison Pratt
27 May 2014 13:30
Forum: Visual Prolog
Topic: commondialogs::tryGet_string
Replies: 10
Views: 3104

Re:

Frank, Thanks for pointing out that vulnerability! Harrison Bad News: 1: If the user cancels the common dialog then the program does not execute the 2: If the user presses the [Enter] immediately without a "y" character the the Response will be an empty string and FC =string::frontChar( Response ) c...
by Harrison Pratt
26 May 2014 23:23
Forum: Visual Prolog
Topic: commondialogs::tryGet_string
Replies: 10
Views: 3104

This is an untested approach you might consider: class facts finding : ( string ClinicalSignOrSymptom ). class predicates ask_put_finding : ( window, string, string ) determ (i,i,i). ask_signs_and_symptoms : ( window, string Patient ) . clauses ask_put_finding( ParentWin, Pt, SignSymptom ) :- Prompt...
by Harrison Pratt
9 Apr 2014 23:17
Forum: Visual Prolog
Topic: Increase integer variable
Replies: 7
Views: 1895

Thanks, Thomas. I understand your meaning.
Code maintainability (by ordinary mortals) and clarity should be the first consideration.
by Harrison Pratt
9 Apr 2014 14:19
Forum: Visual Prolog
Topic: Increase integer variable
Replies: 7
Views: 1895

Question for Thomas: Is this somewhat equivalent code compiled to better/worse/same code as the if/then/else syntax? something(0, Cnt) = Cnt :- !. something(N, Cnt1) = Cnt0 :- 0 = N mod 2 , % if test(...) then !, Cnt0 = something( N-1, Cnt1 ). something(N, Cnt) = Cnt0 :- Cnt0 = something( N-1, Cnt +...
by Harrison Pratt
3 Apr 2014 2:18
Forum: Visual Prolog
Topic: Unreachable or excessive code?
Replies: 11
Views: 2986

I now understand the scope of your problem! That's curious about the numeric constants ... I'll take a look at that. By the way, I usually set up a small class named "app" that handles quirky little configuration parameters, functions, etc. that need global access or storage for each application. It...
by Harrison Pratt
2 Apr 2014 21:12
Forum: Visual Prolog
Topic: Unreachable or excessive code?
Replies: 11
Views: 2986

Re:

Three thoughts on this: (1) If you reverse the order of the statements so the that mandatory fail clause (or the given constant) is last, the compiler does not optimize away any code: checkQuarter(Year,Q) = true():- Year = lastKnownYearInQuarters, list::isMember(Q,["Q1","Q2","Q3","Q4"]), lastKnownQu...
by Harrison Pratt
2 Apr 2014 15:03
Forum: Visual Prolog
Topic: Unreachable or excessive code?
Replies: 11
Views: 2986

Since lastKnownQuarter is a constant ("Q2"), clauses containing a statement like this

Code: Select all

lastKnownQuarter = "Q4",
must always fail, so the test for list membership in the flagged clauses can never be reached.
by Harrison Pratt
24 Mar 2014 13:37
Forum: Visual Prolog
Topic: A list to CSV
Replies: 18
Views: 4260

AHMED, There are several different CSF formats in common use. For example, the Excel-type double quotes strings but not numbers; others double quote only strings which have embedded commas, still others double quote everything. One simple version that quotes everything looks like this: list_write_cs...
by Harrison Pratt
7 Mar 2014 23:27
Forum: Visual Prolog
Topic: Discontiguous facts
Replies: 6
Views: 1673

I believe that discontiguous is a compiler directive in other prologs. It may pop up in an error message at compilation or run time in those languages if clauses having the same signature are separated by one or more dissimilar clauses.
by Harrison Pratt
7 Mar 2014 14:01
Forum: Visual Prolog
Topic: Advanced List handling
Replies: 19
Views: 5411

Re:

Back inthe 5.x and 6.x days what I would do is have 2 predicates. the first was simply a list iterator. the second contained clauses to execute an action (or not). That's what I do in 5.2, also. I try to avoid nondeterminism for bulky processes to avoid the dreaded GStack overflow condition. Below ...
by Harrison Pratt
7 Mar 2014 12:53
Forum: Visual Prolog
Topic: Advanced List handling
Replies: 19
Views: 5411

Re:

Thomas, You are, of course, right about inefficient code. In practice I never recurse into member/2 if it can be avoided. I believe that George's stated intent was to have processing terminate when a specified string was encountered and not process strings after that string. What to do when there is...
by Harrison Pratt
6 Mar 2014 14:58
Forum: Visual Prolog
Topic: Advanced List handling
Replies: 19
Views: 5411

Re:

Two little predicates and your job is done. %-- a member is "before" the Chop %-- as long as the Tail of the list contains the Chop string before_nd( Chop, [S|T], S ):- member( Chop, T ). before_nd( S, [_|T], BF ):- before_nd( S, T, BF ). member( S, [S|_] ):- !. member( S, [_|T] ):- member(S,T). QED...