hint format["The distance is: %1",object1 distance object2]
Note that if you want this to update regularly you will need to make a script out of it.
checkDistance.sqs:
; Our loop
#loop
; Get the distance into a variable
_distance = object1 distance object2
; Display the hint
hint format ["The distance is %1",_distance]
; Wait 0.001 seconds then start over
~0.001
goto "loop"
However, that will return the distance like this : 123.12312343545098
Which is ugly in my opinion, so what you want is this:
checkDistance.sqs
; Our loop
#loop
; Get the distance into a variable
_distance = object1 distance object2
; Round off to the closest lower integer.
_distance = _distance - (_distance mod 1)
; Display the hint
hint format ["The distance is: %1",_distance]
; Wait 0.001 seconds then repeat
~0.001
goto "loop"
There, should get you by.