Problem saving files

Peter Brigham MD pmbrig at gmail.com
Tue Jul 6 16:31:03 CDT 2010


On Jul 6, 2010, at 10:50 AM, J. Landman Gay wrote:

> put ".ext" into tExtension -- use yours
> set the itemDelimiter to "."
> if last item of tFileName <> tExtension
> then put tExension after tFilename

A minor correction: the last item of tFileName in this snippet will be  
something like "ext" -- not ".ext". So you should do something like  
the following:

put "ext" into tExtension -- use yours
-- note the absence of the dot
set the itemDelimiter to "."
if the number of items of tFileName = 1 then
    -- no extension provided by user
    put "." & tExtension after tFilename
else -- extension provided
    if item -1 of tFileName <> tExtension then
       -- wrong extension
       put tExtension into item -1 of tFilename
    end if
end if

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list