News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Qeditor text replacement

Started by Neil, November 10, 2010, 12:11:53 PM

Previous topic - Next topic

Neil

I have used REPLACE TEXT many times  (Successfully) in the past but now I've come across a problem replacing text in my current program. I am renaming a label used a lot of times & qeditor only renames some of them. I've tried it many times with the same result, my question, is there a limit as to how many can be renamed at any one time? I was implementing an idea that Dave came up with a couple of days ago, so it's his fault :bg

jj2007

How many times? I just tried with 370k and 76 items to be replaced, no problem.

Neil


hutch--

Neil,

The replace will work up to the limit of memory on your machine. I have used it on files over 100 megabyte.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Neil

I've just tried again & it's now working O.K. I'm a bit baffled why it wasn't working before. I'll try it again later & see what happens.

dedndave

sounds like user error to me, Neil   :P
perhaps case-sensitivity is the culprit

Neil

Dave, you could be right but that doesn't explain why it replaced 75% of text in the first pass through & when run again it replaced the remainder. One of life's little mysteries ::)
By the way your FlagTable method works a treat & I've found another part of the program that can use it :U

hutch--

Neil,

The algo does a number of things, if the replacement is the same length or shorter it simply allocates a buffer the same length as the selection, does the replacements them writes it back to the edit control. If the replacement is longer than the text being replaced it does a text count in the selection, calculates the extra length required and allocates a bigger bufffer first then it does the replacement. It will then run one of two replacement algos, a simple text replace or a whole word replace. In every case it only works on the complete selection and does the replace from beginning to end, there are no partial limitations with either algo.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Neil

Thanks for the explanation hutch. Can you clear up one final point, I was replacing a 4 character word with an 8 character one should I have used Normal Text Replace or Whole Word?

hutch--

Neil,

Whichever you need. They are two separate algos that perform different tasks.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php