sonne17111 Posted August 16, 2005 Posted August 16, 2005 Hi! Maybe someone can help me on this topic. I want to get only new text from the WinGetText. How can I do this? It means at the first call of wingettext I get a text. Then later I do again wingettext and this time I only need the new text and not all the text again. Anyone see a solution? Thank!
Lazycat Posted August 16, 2005 Posted August 16, 2005 If text always appends at end you can keep copy of full previous text in the string (or it's length) and then StringTrimLeft it (pseudocode, I don't know what exactly you need): $text_prev = "" While ... $text_cur = WinGetText(...) $text_new = StringTrimLeft($text_cur, StringLen($text_prev)) $text_prev = $text_cur Wend Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
sonne17111 Posted August 16, 2005 Author Posted August 16, 2005 If text always appends at end you can keep copy of full previous text in the string (or it's length) and then StringTrimLeft it (pseudocode, I don't know what exactly you need):
Lazycat Posted August 16, 2005 Posted August 16, 2005 Additional problem is this:The text I get is something like a log. It means all the time new text arrive at the end. And I want to get all this text line by line. So I can do this with the code above.WinGetText take all text, so if you need lines, you have split text by @CR or @LF.But what if after sometime the begin lines of the text removed? Any solution for this too??Hm, maybe need to add size check: if current text length is less then previous, you can assume that log was reset, so in this case you need empty $text_prev. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now