Weird Problem with replaceText
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Mon Apr 18 12:46:27 EDT 2005
Hi Dave,
You might choose another method:
set the itemDel to slash
put the filename of this stack into tPath
put "StackFileAnotherFile.rev" into item -1 of tPath
Le 18 avr. 05, à 18:39, David Burgun a écrit :
>> Hi Dave,
>>
>> put replaceText(the filename of this stack,the short name of this
>> stack,"xxxxxxxxxx") into myString
>>
>> Works fine here when the name of the file is the same as the name of
>> the stack (disregarding the extension).
>> But they can be DIFFERENT and then associate these 2 references
>> might not be a good idea ;-)
>> Best,
>
> In this case they are the same. I just want to replace:
>
> /aaaaa/bbbbb/ccccc/ddddd/eeeee/fffff/StackFileA.rev
>
> with
>
> /aaaaa/bbbbb/ccccc/ddddd/eeeee/fffff/StackFileAnotherFile.rev
>
> Can't see it should make a difference where the data comes from.
>
> Oh well, another mystery!
>
> It works from the Mesasage Box BTW if I put a breakpoint into the
> code and run it manually!
>
> Cheers
> Dave
>
>
>>
>> Le 18 avr. 05, à 17:34, David Burgun a écrit :
>>
>>> Hi,
>>>
>>> Anyone got any ideas on this one:
>>>
>>> This doesn't work:
>>>
>>> local myString
>>>
>>> put replaceText(the filename of this stack,the short name of this
>>> stack,"xxxxxxxxxx") into myString
>>>
>>> The Trailing ".rev" is removed
>>>
>>> Whereas this does:
>>>
>>> local myTemp1
>>> local myTemp2
>>> local myString
>>>
>>> put the filename of this stack into myTemp1
>>> put the short name of this stack into myTemp2
>>> put replaceText(myTemp1, myTemp2,"xxxxxxxxxxxxxxxx") into myString
>>>
>>> works as expected and leaves the .rev in place.
Eric Chatonet.
----------------------------------------------------------------
So Smart Software
For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email eric.chatonet at sosmartsoftware.com/
Phone 33 (0)1 43 31 77 62
Mobile 33 (0)6 20 74 50 86
----------------------------------------------------------------
More information about the use-livecode
mailing list