>I tried Google on this but the answers were out of my league.
>I need the algorithm (in VFP) to determine if two containers on a form overlap at any point. The code I did now has 8 Between() statements and still does not cover all possibilities.
Assuming the rectangles use vertical and horizontal lines, as can be assumed if you use containers; also, one rectangle has horizontal coordinates a1 and a2 (a1 less-than a2), the other has horizontal coordinates b1 and b2 (b1 less-than b2):
The horizontal coordinates of the two will NOT overlap if either a2 less-than b1, or b2 less-than a1. Or less-than-or-equal, depending on the definition.
Similar with the vertical coordinates.
To have no overlap at all: either the horizontal coordinates don't overlap, or the vertical coordinates don't overlap. If both overlap, the rectangles overlap.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)