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