define variable lr as int64 no-undo.
define variable rr as int64 no-undo.
define variable rx as int64 no-undo.
define variable sr as int64 no-undo.
define variable ir as int64 no-undo.
define variable p1 as character no-undo label "From".
define variable p2 as character no-undo label "To".
define variable showData as logical no-undo label "Show Data".
define query q for customer fields( name ) cache 5000.
find _myconnection no-lock no-error.
do while true:
find _userio no-lock where _userio-id = _myconn-userid + 1 no-error.
find _actSummary no-lock no-error.
find _actIndex no-lock no-error.
assign
lr = _userio-dbaccess
rr = 0
rx = 0
sr = _summary-recReads
ir = _index-Find
.
update
p1 p2 skip
showData skip
skip(1)
with
side-labels
no-box
.
if p1 = "" and p2 = "" then
open query q for each customer no-lock.
else if p1 <> "" and p2 <> "" then
open query q for each customer no-lock where name >= p1 and name <= p2.
else if p1 <> "" then
open query q for each customer no-lock where name >= p1.
else if p2 <> "" then
open query q for each customer no-lock where name <= p2.
get first q.
do while available customer:
rr = rr + 1.
if showData = yes then
do:
display name with frame a down no-box row 12.
down 1 with frame a.
end.
rx = rx + 1.
get next q.
end.
close query q.
find _userio no-lock where _userio-id = _myconn-userid + 1 no-error.
find _actSummary no-lock no-error.
find _actIndex no-lock no-error.
display
( _userio-dbaccess - lr ) label "logical reads"
( _summary-recReads - sr ) label "record rds"
( _index-Find - ir ) label "index rds"
rr label "records read"
rx label "recs displayed"
with
1 column
side-labels
.
pause.
hide frame a no-pause.
end.