Jon Paul Alongi wrote:
>how can i show just the filename and not the whole path in a text box....
Mark A. Boyd wrote:
> Look into using the itemDelimiter to get the last (or possibly next to
last) item in the path.
Mark is right - this is the code that I use
As this is quite a common function for me, I set this up as a function:
on GetNameFromPath thePath
backup = the itemDelimiter
if the platform contains "mac" then
the itemDelimiter = ":"
else
the itemDelimiter = "\"
end if
theItem = the last item of thePath
the itemDelimiter = backup
return theItem
end
To use this function you assign the result of the function to a variable,
such as
myFileName = GetNameFromPath(myFullPath)
*NOTE*
Because Macs and PC use different characters to chop up file paths
("delimiters"), you will need to test for the computer platform and make the
relevant change. This is what the "if platform contains" bit is about.
Hope this helps
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]