Space at end of folder name

B

Billy B

Using the generic BrowseForFolder function, the returned string value has a
square at the end of the path's folder name. I never realized it before, but
after single clicking a folder in Windows Explorer there appears to be an
extra non printing character. What is the character and how do you remove it
from the string.

When I place my cursor over the string this is what I see:
"C:\Testing[square]"

Thank you
 
T

Tony Toews [MVP]

Billy B said:
Using the generic BrowseForFolder function, the returned string value has a
square at the end of the path's folder name. I never realized it before, but
after single clicking a folder in Windows Explorer there appears to be an
extra non printing character. What is the character and how do you remove it
from the string.

That's probably a null or binary 00. Many API calls use that
character to terminate the string. All the code that I can recall
seeing strips off that string.

What URL did you get that code from?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
B

Billy B

Thank you Tony. I can't remember where I got it. I found it a while back and
saved it for keeps sake. Just now using it.
 
T

Tony Toews [MVP]

Tony Toews said:
That's probably a null or binary 00. Many API calls use that
character to terminate the string. All the code that I can recall
seeing strips off that string.

Actually I was just using some API code yesterday and it refreshed my
memory. Sometimes the string is returned along with a length. You
then use only what's mentioned in the length. What gets stripped is
frequently the null character.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Top