I was hoping to avoid doing this myself. Anyway I've had a go. If there's anyone who is more knowledgable about these things than me that could check it over and tell me if I'm doing this right I'd much appreciate it.
Strict
Local source:String=RequestFile("source")
Local destination:String=RequestFile("destination")
Print ExtractRelativePath(source,destination)
Function ExtractRelativePath:String( src:String, dest:String )
src=ExtractDir(RealPath(src))
dest=RealPath(dest)
Local count:Int=0
While src<>Left(dest,Len(src))
count:+1
Local i:Int=src.FindLast("/")
src=src[..i]
Wend
dest=dest.Replace(src,"")
dest=dest[1..]
For Local i:Int=1 To count
dest="../"+dest
Next
Return dest
End FunctionI have no idea if it's cross platform, but it
seems to work on windows. Surely someone has already done this? Thanks.