Welcome! Log In Create A New Profile

Advanced

string Input from search

Posted by dappel 
dappel
string Input from search
June 21, 2009 11:34PM
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)

Mycontent = edit field with RTF layout

mycontent..Cursor = 1
rEXPRESS is int
t is string
rEXPRESS=RTFSearch(mycontent,"Klein vrachtschip",rtfFullWord)
t = Middle(mycontent,rEXPRESS,20)

Trace(t)
Trace(rEXPRESS)



Edited 1 time(s). Last edit at 06/21/2009 11:39PM by dappel.
Jimbo
Re: string Input from search
June 22, 2009 08:29AM

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.

Regards,
Guenter


Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: