Replacing Text

Warren Kuhl warrenkuhl at gmail.com
Mon Jan 25 12:39:53 EST 2010


Mark,

Your seconds example worked great.  I assume the first example you
provided would replace multiple occurenences of the text if it
existed?  The second example doesn't do this and is exactly what I was
trying to resolve.

Thanks for your help!
Warren

On Mon, Jan 25, 2010 at 11:34 AM, Mark Schonewille
<m.schonewille at economy-x-talk.com> wrote:
> Hi Warren,
>
> The selectedChunk is a reference to particular characters in a field. Also,
> the selectedChunk of fld x isn't a reference the actual text in that field
> but rather a string containing that reference.
>
> For example, if you tell Revolution to replace "xyz" with "abc" in "char 1
> to 2 of field 1" it isn't going to work.
>
> You might try this.
>
> put the selectedText into mySelection
> replace mySelection with "<b>" & mySelection & "</b>" in field x
>
> or
>
> put the selectedText into mySelection
> put "<b>" & mySelection & "</b>" into the selectedChunk
>
> I have tested this and both methods work.
>
> --
> Best regards,
>
> Mark Schonewille
>
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
>
> Try the new URL shortening service http://qurl.tk
>
> Op 25 jan 2010, om 18:20 heeft Warren Kuhl het volgende geschreven:
>
>> I am trying to replace a selected chunk of text with the selectedchunk
>> of text and some html codes.  I tried the code below and the software
>> doesn't like this.
>>
>> replace the selectedtext of field "field" with "<b>" & the
>> selectedtext of field "field" & "</b>" in the selectedchunk of field
>> "field"
>>
>> I could use:
>> replace the selectedtext of field "field" with "<b>" & the
>> selectedtext of field "field" & "</b>" in field "field"
>> ...but the replace would replace all occurrences of the text in my
>> field...instead of just the selectedchunk.
>>
>> How would I accomplish this?  I assume it is something simple.
>>
>> Warren
>
>
> _______________________________________________
> 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