string Input from search

Startbeitrag von dappel am 21.06.2009 21:34

i wanne have the result of the RTF search as start positions for my exstraction of my string
buth the exstraction seems to ignore my first line of code it starts from the beginning
the result of RTF search shoud be the startpoint for middle,did i forgot somthing in my code below?end then he shoud stop exstracting at a ("") certain word)

Antworten:

Hi,

your code should work, except for the 'Middle(..)' which will show less characters than searched for every now and then. RTF is a mark-up-language like HTML and contains many more characters than you can see! One foreign-language RTF-character could consist of up to 100 real characters!! Never use anything else than memo-type strings for RTF-text!

If you're searching within an RTF-text then RTFSearch(..) is OK. 'Middle' will not always give you back the *full* search argument. Two workarounds:

1 - if rExpress > 0 then you know that you've found the search argument, why do an extract by Middle(..) after all?

2 - If extraction is a must, you can still convert RTFtoText(..), do the search / extract there, throw away the text and revert to the original RTF-text.