Oh, that's a dll... (GLBlitz if you want to know. I don't know where I got it but it basically fills a few holes in the b3d command set)
Just use this function:
Function Distance#(x1#,y1#,x2#,y2#)
;Uses pythagoreus theorum
Return Sqr(((x2-x1)^2)+((y2-y1)^2))
End Function