Weird Problem with replaceText

David Burgun dburgun at dsl.pipex.com
Mon Apr 18 12:55:14 EDT 2005


I've got it to work just by assigning the names to variables and then 
using the variables in the replaceText function., as in:

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

This works fine. I just wanted a one liner to get the name of a Stack 
other that the current stack in the current Folder. Something like 
this:

start using replaceText(the filename of this stack, the short name of 
this stack,"xxxxxxx")

Would be good. It's just some linkage I need in a lot of different 
Scripts and I want to make

If there is a better way, I'd bet happy to do it that way!

All the Best
Dave


>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
>----------------------------------------------------------------
>
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list