How to replace only in highlighted area?

Hello all,

Is there a way to replace all matching text with new text - but only in an area highlighted?

Thanks,
Tim

Something like tfField.selText = tfField.selText.replaceAll("find", "replace") should work.

If it’s a TextArea control, take a look at http://documentation.xojo.com/index.php/TextEdit.SelText

Hi guys,
I guess I was not very clear. I meant using the IDE tools. Select a portion of code where one part of it needs to be changed.

For example, I copy/paste code from one place to another, but need to edit that block of code somehow. If I use the IDE, I cannot find a way to only do the part that has been highlighted.

Tim

[quote=282163:@Tim Seyfarth]I guess I was not very clear. I meant using the IDE tools. Select a portion of code where one part of it needs to be changed.
[/quote]

Ah. No, I think the minimum is the method/event you are within. However, you can copy the selection to a text editor, do the find/replace there, and just paste it back. I do that sometimes (my text editor has more powerful find/replace).

You can also do the search (limited to the method) and in the listed matches select just the ones in the selection area and hit the “Replace #” button.

[quote=282163:@Tim Seyfarth]I guess I was not very clear. I meant using the IDE tools. Select a portion of code where one part of it needs to be changed.

[/quote]

REALStudio had that… unfortunately that feature did not make it into Xojo… and I find myself missing it more and more.

  • Karen

In that case, I copy the code (hightlighted code) and paste it in a word processor then I’ve made the search/replace there.

Remember: I feel insecure using Xojo Code Editor (Xojo IDE…) I have to work slowly to not be surprised by what happens [I may start a contest: how many times a Xojo IDE working session do I say “what happends ?”]