@David iz cool : This is untested, but is based on a code posted by spooky so it should work.
sync on : sync rate 60 : autocam off
make object cube 1,10
make object cube 2,10
make object cube 3, 10
make matrix 1,500,500,32,32
position matrix 1,-250,0,-250
position object 1,-10,5,20
position object 2,10,20,20
position object 3, 0, 12.5, 20
position camera 0,5,-20
do
control camera using arrowkeys 0,2,2
set cursor 0,0
print "3D distance between objects 1 & 2 = ";range3D(1, 2)
print "3D distance between objects 2 & 3 = ";range3D(2, 3)
print "3D distance between objects 1 & 3 = ";range3D(1, 3)
sync
loop
rem distance between 2 objects
function range3D(obj1, obj2)
null3D=make vector3(3)
ax#=object position x(obj1)
ay#=object position y(obj1)
az#=object position z(obj1)
bx#=object position x(obj2)
by#=object position y(obj2)
bz#=object position z(obj2)
set vector3 3,ax#-bx#,ay#-by#,az#-bz# : result#=length vector3(3)
null3D=delete vector3(3)
endfunction result#