Starting with the location of one selected CustomObject I want to get a handle to another CustomObject which is close to this object and do something with that object. Imagine to a for instance a Pipe System where I bring to objects close to each other (via underlying grid). After they are positioned this way they should interact with their neighbour (change some RecordFields).
I thought GetClosestPt() would be the right approach but when I tested the example from the function refence I didn't get any reaction when I clicked (=GetPt()) near a simple rect. Also the Debugger shows that no objhandle is identified.
1) Does anybody know how to use this function correctly?
PROCEDURE GetClosestPtExample;
VAR
obj :HANDLE;
ptX, ptY :REAL;
index :INTEGER;
containedObj :LONGINT;
BEGIN
{$Debug}
GetPt(ptX, ptY);
GetClosestPt(obj, ptX, ptY, index, containedObj);
SetPenFore(obj, 65535, 0, 0);
END;
RUN(GetClosestPtExample);
2) If this function doesn't work. Has anybody an alternative solution for my problem?