Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 9 Jahren
Letzter Beitrag:
vor 9 Jahren
Beteiligte Autoren:
Jimbo, dappel

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)

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)




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.


von Jimbo - am 22.06.2009 06:29
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.