Re: FTC 1.8.2

Hi Brendan,

All my software is based on searching and replacing some variables.
So I need to do that a lot, and it is very time consuming.


my current code is:
...
  
  resultadoformatado = ReplaceAll(resultadoformatado, "asagoldman$", asaNUM2)
  resultadoformatado = ReplaceAll(resultadoformatado, "medico$", medico.Text)
  resultadoformatado = ReplaceAll(resultadoformatado, "goldman$", GoldmanNUM)
  resultadoformatado = ReplaceAll(resultadoformatado, "goldmanrisco$", 
GoldmanRisco)
  resultadoformatado = ReplaceAll(resultadoformatado, "nome$", nome.Text)

...

where resultadoformatado is a string that holds all the text and images; and 
after all the replacing:

...
  
  Dim sr as FTStyleRun
  Dim p as FTParagraph
  ' Create the paragraph.
  p = ResultadoF.getDoc.addNewParagraph
  ' Create a style run.
  sr = new FTStyleRun(ResultadoF)
  ' Add the text to the style run.
  ResultadoF.getDoc.setXML (resultadoformatado)
  ResultadoF.update(true, true)

...

Thanks a lot


Alexandre Amato




On 03/06/2010, at 18:34, Brendan Murphy wrote:

> Alexandre Amato wrote:
>> I would like to know what is the best way to do a "search and replace"
>> I've been using Realbasic's ReplaceAll, but it is too slow !! Worse  
>> if there are pictures inside the text.
> 
> I need a little more detail. What is it you have done to implement
> search and replace? Do you have a sample project with your code?
> 
> FTC Website: http://www.truenorthsoftware.com/formattedtextcontrol
> Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
> List Archive: www.freelists.org/archives/ftcdev
> Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
> the subject field.
> 
> 
> 

FTC Website: http://www.truenorthsoftware.com/formattedtextcontrol
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.



Other related posts: