Hi there,
I would like to extract content from a text widget into a string from a certain point on this means from a the point after a certain line had appeared.How do I go about that? I can't figure out how i can get the current length and then only extract the content from current length on. I put this bit of code together trying to display what I'm looking for:
Thank you for any help or suggestions!
Ron
I would like to extract content from a text widget into a string from a certain point on this means from a the point after a certain line had appeared.How do I go about that? I can't figure out how i can get the current length and then only extract the content from current length on. I put this bit of code together trying to display what I'm looking for:
Code:
set rslt -1
while {$rslt == -1} {
set str [.serialMon.cons get 0.0 end] ;#load content from console window into $str
set rslt [string first "Pass: 10" $str] ;#search for the string "Pass: 10" in $str
if {$str != -1} { ;#When we found "Pass: 10" in the string
while {!$NewStr}
#load all the new content from .serialMon.cons from into a different string
#but we don't want to have the old stuff
regexp {\W\W\w\w\W\W\w\w\s\W\s\W\W\w\w\W\W\w\w\s\W\s} $NewStr exp
}
#.serialMon.cons insert end "\n------------- $exp\n"
finaltest::delay 1000
}
Thank you for any help or suggestions!
Ron