Well, we don't have enough- actually we don't really have any information on how you implemented the clicking thing, so we ca just assume you used pick object or pick screen for that (if you don't know any of these commands, type them into the DBP editor and press F1).
I haven't used them so far, but as it seems they work together with the get pick distance() command which should be just what you need.
Something like this in your mainloop would maybe do the job:
...
obj = pick object(mousex(), mousey(), 1, highestObjectID)
if obj > 0
dis# = get pick distance()
if dis# < minimumDistanceToClickAnObject
doSomething()
endif
endif
...