Problem saving files
J. Landman Gay
jacque at hyperactivesw.com
Tue Jul 6 18:11:50 EDT 2010
Peter Brigham MD wrote:
> 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
Oops. You're absolutely correct. Wasn't thinking.
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list