Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addbs adds no backslash
Message
From
24/10/2006 16:17:17
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01163916
Message ID:
01164177
Views:
8
>>>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,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform