* note clock reading for generating final timing statistics lnStartTime = seconds() && # seconds since midnight select BldMstr lcOrder=order() set order to lnRecno=recno() && Save current record * support user Escapes for interrupting the main loop lcPrevOnEsc = on('escape') && save previous Escape handler lcPrevEscape = set('escape') && previous Escape enablement state set escape on && enable escape handling llHalt = .f. && allow loop to run until this flag is toggled on escape llHalt = .t. && force immediate termination if user escapes store 0 to lnTally, lnCount, lnBadApn, lnSuspect lnReccount=reccount() lnThreshold=int(m.lnReccount/10) && 10% do case case m.lnReccount<100 && Very rare case lnUpdateNumber=1 case between(m.lnReccount,100,100000) lnUpdateNumber=100 case m.lnReccount>100000 lnUpdateNumber=val('1'+replicate('0',len(transform(m.lnReccount))-3)) endcase * assemble fixed portion of status bar message outside of loop, for speed lcMsgTail = "/" + transform(m.lnReccount) + ". Wait or press Esc to cancel ..." set message to "" *--- instantiate thermometer bar class.... loTherm = newobject("thermometer", "wg","","Progress for APN calculating...", m.lnReccount) loTherm.show() scan lnCount=m.lnCount+1 * check for user Escape if m.llHalt && user escaped exit && fall out of loop endif ** Update thermometer if mod(m.lnCount, m.lnUpdateNumber) = 0 set message to 'Record # '+alltrim(str(m.lnCount))+m.lcMsgTail loTherm.update(m.lnCount) endif