pxstatus px_log_lines_last(px3s *theresult,pxn thelinecount){
_empty(theresult) _b
_px3s(s){
_px2file(myfile,dpxlogfile,"rb") _exec(myfile.read(&s))
}
pxn mylinestart=0;{
pxn mylinecount=0; _exec(s.linecount(&mylinecount))
if(!mylinecount) return pxok;
if(thelinecount>mylinecount) thelinecount=mylinecount;
mylinestart=mylinecount-thelinecount;
}
_for(i,thelinecount){
pxn mylineindex=i+mylinestart;
_px3s(myline) _exec(s.linex(&myline,mylineindex)) if(!myline.itslen) continue;
_px3s(myfld) _exec(myline.fieldx(&myfld,0)) _exec(myfld.trim()) if(!myfld.itslen) continue;
b=0; _exec(myfld.isvalidinteger(&b)) if(!b) continue;
_exec(theresult->lineadd(&myline))
}
_exec(theresult->addnewlinemodest())
return pxok;
}