Cy
Thu Dec 20 00:04:42 CST 2007
Michael Asherman wrote:
> "Olaf Doschke" <b2xhZi5kb3NjaGtlQHNldG1pY3MuZGU@strconv.14.de> wrote in
> message news:uoVAJzXPIHA.4684@TK2MSFTNGP06.phx.gbl...
>>> Cy,
>>>
>>> Maybe I wan't clear enough. You are mistaken, I believe. Try it
>>> yourself - ADDBS does *not* add a backslash to the empty string. I agree
>>> that one would expect it never to return the empty string. That was my
>>> point!
>> Well, still the argument holds true.
>>
>> ADDBS() is made for paths.
>>
>> No BS is needed for an empty path = no path.
>> This would make the empty path the current Dir path,
>> which would be something totally different.
>>
>> Bye, Olaf.
>>
>
> Olaf,
>
> That's an interesting rationalization, but consider the case of a path like
> "C:", for which ADDBS would return "C:\". By the same token, these might be
> totally different directories or they might be the same, depending on what
> is your current directory. Obviously the problem is the incredibly vague
> phrase "if needed", which has no place in Help documentation, IMO. Anyway,
> the reason I brought it up was to warn others about this highly non-obvious
> pitfall. I'll bet that the majority of VFP programmers, if asked what
> result they would expect from ADDBS(''), would unhesitatingly answer '\',
> unless they learned this one the hard way.
>
> Mike
>
>
Your right as it didn't add a backslash to the empty string. And
contrary to what I remember, it doesn't pay attention to trailing spaces
either.
--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com