Search found 305 matches

by Harrison Pratt
24 Nov 2011 14:01
Forum: Visual Prolog
Topic: How to check a valid date?
Replies: 11
Views: 3812

Dear George,
I think for the leap year calculation we required one more condition..
Thank you, you are correct! I shouldn't post un-used and un-tested code (see comment in my first post).

Best regards,
Harrison
by Harrison Pratt
23 Nov 2011 16:12
Forum: Visual Prolog
Topic: How to check a valid date?
Replies: 11
Views: 3812

A little more prolog style approach in VIP 5x: predicates valid_date( unsigned, unsigned, unsigned, unsigned, unsigned ) -(i,i,i,i,i) month( unsigned, string, string, string, unsigned ) valid_d( unsigned, unsigned, unsigned ) -(i,i,i) clauses valid_date( YMin, YMax, M,D,Y ):- Y <= YMax, Y >= YMin, v...
by Harrison Pratt
23 Nov 2011 6:51
Forum: Visual Prolog
Topic: How to check a valid date?
Replies: 11
Views: 3812

Check for leap year, old VIP 5.3 style: /****************************************************************************** dte_leapYear( INTEGER YearAsYYYY ) -(i) Suceeds if YYYY is a leap year according to the following: Rules for Leap Year: (1) Year Divisible by 4 is a leap year, but (2) year divisib...
by Harrison Pratt
25 Oct 2011 13:59
Forum: Visual Prolog
Topic: heap overflow error
Replies: 6
Views: 1913

I was reading your mind while I was posting my thoughts! :wink:
by Harrison Pratt
24 Oct 2011 21:46
Forum: Visual Prolog
Topic: heap overflow error
Replies: 6
Views: 1913

Your code is not tail recursive, because the recursive call is not the last clause. There should be no untried solutions when you finally make the recursive call. The stack frame is not discarded before the last recursive call ... so the stack keeps growing. I think your image procesing clauses migh...