File Name in Field?

Eric Chatonet eric.chatonet at sosmartsoftware.com
Wed Aug 6 06:39:03 EDT 2008


Heather,

Le 6 août 08 à 12:15, H Baric a écrit :

> On opening a text file with the dialog, and displaying the contents  
> in a field: is there a way to retrieve just the filename? (so I can  
> put it in it's own field)

local tFilePath, tFileName
answer file "Choose a file:"
if it <> empty then
   put it into tFilePath
   put FilePathToShortFileName(tFilePath) into tFileName
   etc.
----------------------------
function FilePathToShortFileName pPath
   set the itemDelimiter to slash
   return item -1 of pPath
end FilePathToShortFileName

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list