Woo! First to post this!
People like to use vectors for distance in DBPro, which are fast, but for some reason their functions only use one vector number, so this is my version:
sync on
null=make vector3(1)
make object cube 1,100 : make object cube 2,100
position object 1,rnd(1000)-500,rnd(100),rnd(1000)-500
position object 2,rnd(1000)-500,rnd(100),rnd(1000)-500
do
`Return Value=GetDist(Object 1, Object 2, Vector)
dist#=getdist(1,2,1)
sync
loop
function getdist(o1,o2,vec)
xdist#=object position x(o2)-object position x(o1)
ydist#=object position y(o2)-object position y(o1)
zdist#=object position z(o2)-object position z(o1)
set vector3 vec,xdist#,ydist#,zdist#
dist#=length vector3(vec)
endfunction dist#
Untested btw.