Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 8 Jahren, 3 Monaten
Letzter Beitrag:
vor 8 Jahren, 3 Monaten
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)

Trace(t)
Trace(rEXPRESS)

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.

Regards,
Guenter




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.