11-15-2012, 06:10 PM
Finally, found a way, but need some improvements
1. I want to limit the variable named liste to max 64000, by truncating some portion to keep only last lines. But how to truncate it from the beginning? liste.fix seems to do it by the end.
2. I presume the (+) in liste declaration make it available as long as QM is launched. Correct?
3. Is there a better way for you to do that code (less memory usage, better regex etc)?
4. Can i clear qm output in code?
function event pid pidparent $name
event: 1 started, 2 ended, 4 running
str+ liste ok ok1 ik
sel event
case [1,4]
ok.format("%s - %i" name pid)
liste.formata("%s - %i[]" name pid)
out liste.len ;;test purpose
liste.addline(ok 1)
case 2
ok1.format("%i" pid)
findrx(liste F"(\w+) - {ok1}" 0 11 ik 1)
if(ik.len) out ik.trim ;; test purpose
ik.all
1. I want to limit the variable named liste to max 64000, by truncating some portion to keep only last lines. But how to truncate it from the beginning? liste.fix seems to do it by the end.
2. I presume the (+) in liste declaration make it available as long as QM is launched. Correct?
3. Is there a better way for you to do that code (less memory usage, better regex etc)?
4. Can i clear qm output in code?