>>>I have noticed that addbs() does not add a backslash if given an empty path. I'd expect a backslash even in that case, creating a reference to the root! I can't imagine that this was done by design. Who's at vault?
>>
>>empty to empty, it is correct.
>>
>>within VFP an "empty path" is "the default directory",
>>and ADDBS() must preserve it.
>>
>>
>>? FILETOSTR("filename.filetype")
>>* this must to be equal
>>? FILETOSTR(ADDBS(JUSTPATH("filename.filetype"))+JUSTFNAME("filename.filetype"))
>>
>
>Why on earth should the second case be equal to the first one?! The addbs() function is meant to eventually modify the string.
Here it is the point!
the ADDBS syntax is not ADDBS(cExpression), but
ADDBS(cPath)
ADDBS() it doesn't receive a string as parameter but a cPath.
As it has to preserve the Path that represents,
and because in the cPath dataspace:
"" == "." == ".\" not = "\"
empty has to remain empty.
I hope that this clarifies the matter.
>Empty to empty is NOT the correct handling, because in that case the function does not do what it promisses, that is, to add a backslash.
Peter,