File Name in Field?
H Baric
hbaric at gmail.com
Wed Aug 6 07:34:59 EDT 2008
Aha! Okay, so I was kind of on the right track, in my straightforward
non-functiony beginners script - that didn't work :(
I tried to return item 2, 3... (oops) of all kinds of things, including
"it" and it in variable, without realising you have to set the delimiter
thing first.
And -1 of course! Duh.
Okay, great got it.
Thanks once again Eric.
Just send me a bill for your wonderful services :D
Cheers,
Heather
----- Original Message -----
From: "Eric Chatonet" <eric.chatonet at sosmartsoftware.com>
To: "How to use Revolution" <use-revolution at lists.runrev.com>
Sent: Wednesday, August 06, 2008 8:39 PM
Subject: Re: File Name in Field?
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/
----------------------------------------------------------------
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list