Search found 287 matches

by Harrison Pratt
25 Jan 2014 14:03
Forum: Visual Prolog
Topic: Read from an external file.
Replies: 17
Views: 4701

Copy from Word to Windows clipboard, retrieve from clipboard in your application with tryGetString/0-> tryGetString : () -> string String determ. It is acceptable to have the user open Word and export some (or all) of the document. That's the fastest way to get started since you don't seem to have s...
by Harrison Pratt
24 Jan 2014 23:17
Forum: Visual Prolog
Topic: Read from an external file.
Replies: 17
Views: 4701

Ahmednadi, Can you give more specifics ... Will your application require an installed version of Word, or do you want to read the file directly without using MS Word? Do you want ALL of the document, or a specific part of it? Is it acceptable to have the user open Word and export some (or all) of th...
by Harrison Pratt
16 Jan 2014 14:16
Forum: Visual Prolog
Topic: define clause with value from edit control
Replies: 6
Views: 2024

Look at "single" facts.
by Harrison Pratt
29 Nov 2013 4:33
Forum: Visual Prolog
Topic: Do we have any built in predicate to validate whether the input date is valid or not..??
Replies: 12
Views: 3599

Re: time::isValidDate predicate was not working as expected

Perhaps it is _designed_ to test the validity of a future date (200 - CurrentMonth) a certain number of months into the future? Can you get a valid date response if the input Month is negative (for a date before the current month)? If so, the designed function would seem to be to assess the validity...
by Harrison Pratt
1 Aug 2013 21:02
Forum: Visual Prolog
Topic: Vip saves a Nan (Not a Normal Number) but consulting gives a problem
Replies: 5
Views: 1884

You can write predicates and objects, but it makes little sense to read them back in.
Could you explain why one might want to write predicates and objects but not read them?
by Harrison Pratt
6 May 2013 21:44
Forum: Visual Prolog
Topic: How can I close and trigger an application started by vpi::createprocess?
Replies: 6
Views: 2376

I have been working on this problem in VIP 5.2 and my strategy is to store the ApplicationID using push_AppID/2 when launching an external application. In the Task window event handler for e_EndApplication, call pop_AppID( AppID ). If it finds a corresponding AppID in the database, that AppID is ret...
by Harrison Pratt
16 Apr 2013 23:11
Forum: Visual Prolog
Topic: how can i now if i point inside polygon?
Replies: 6
Views: 1692

This whole topic of inside vs. ouside of polygons is interesting ... but if you are in a hurry to get your project done, try this technique: On your mouse event, call a clause which gets the COLOR of the pixel using vpi::winGetPixel/2. If every object is a different color, the color of the pixel wil...
by Harrison Pratt
16 Apr 2013 20:38
Forum: Visual Prolog
Topic: how can i now if i point inside polygon?
Replies: 6
Views: 1692

Re: Point in Polygon Strategies

Ferenc Nagy wrote:Read http://erich.realtimerendering.com/ptinpoly/ and choose the methods which you think simplest.
Great reference (and links within), thanks!

Harrison

ADDENDUM: Nice discussion here: http://stackoverflow.com/questions/2175 ... a-hit-test
by Harrison Pratt
15 Apr 2013 13:33
Forum: Visual Prolog
Topic: how can i now if i point inside polygon?
Replies: 6
Views: 1692

(1) Could you define some small areas within your polygon that are visual "handles" that would "light up" when the mouse hovers over that area (or the sensor area mentioned below)? "Handles" near the ends of the shape could be used to rotate it and one in the center could to move the polygon. Take a...
by Harrison Pratt
13 Apr 2013 21:17
Forum: Visual Prolog
Topic: How can i draw quarter of a Ellipse?
Replies: 10
Views: 2441

(1) Daniel, will vpi::drawRoundRect/4 work for your application?

(2) Thomas Linder Puls, is there anything like the VIP 7.4 GDI+ support available in VIP 5.2? Those are some wonderfully life-simplifying tools accessible in VIP 7.4!
by Harrison Pratt
12 Apr 2013 10:21
Forum: Visual Prolog
Topic: How can i draw quarter of a Ellipse?
Replies: 10
Views: 2441

It sounds like something related to what I've been working on lately, drawing radial graphs of wind direction and velocity using the radius as the time axis (24 hr is the full radius). Two options come to my mind for your problem: (1) Compute the equation for the ellipse and draw it using a point(X,...
by Harrison Pratt
31 Mar 2013 16:49
Forum: Visual Prolog
Topic: Use edit control
Replies: 7
Views: 1970

You are making this harder than it needs to be. You don't need to create a variable to hold the Angle and Velocity parameters you enter -- they are stored within the corresponding edit controls. When you click on [THROW], that control (the button) should fetch the displayed values from each of the e...
by Harrison Pratt
19 Jan 2013 16:17
Forum: Visual Prolog
Topic: Prolog Relations between persons
Replies: 2
Views: 1444

You need rules defining other relations. kindOfDescendant( p1, p2, CHILD ):- child_of( p1, p2 ). kindOfDescendant( p1, p2, GRANDCHILD ):- grandchild_of( p1, p2 ). grandchild_of( c1, gp ):- parent_of( p, c1 ), parent_of( gp, p ). You are not using Visual Prolog. You might have more luck at other prol...
by Harrison Pratt
19 Jan 2013 15:17
Forum: Visual Prolog
Topic: Prolog Relations between persons
Replies: 2
Views: 1444

Think a little more about your data source and how you map that into prolog facts. Instead of using f( name ) m( name ) consider using p( sex, name ) % person however, to make that work in your other code you will need to declare a special domains PDOM = p( sex, name ) If you are not yet quite ready...
by Harrison Pratt
4 Jan 2013 18:33
Forum: Visual Prolog
Topic: pass 2 variable at one time
Replies: 9
Views: 2635

Re: pass 2 variable at one time

How about using a string list: [Name,Btn] ?? Hello, I need to pass 2 variables from a dialog so I used predicates tryGetName : (window Parent) -> string Name determ. predicates tryGetBtn : (window Parent) -> string Btn determ . but then I have to press 2 times the OK btn... Is it possible to avoid t...