Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recno() Order
Message
From
16/11/2000 20:04:02
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00442673
Message ID:
00442997
Views:
10
PMJI Nadya, but that's an awesome HTML block of code for a simple example:-). Do you hand code that or do you have a tool that formats it for you?

>Bellow is the tecnique I use. One additional note: if your table is ordered don't use just scan... endscan (it would be slower). Either use scan while!eof() endscan or do while!eof()... skip... enddo.
>
>
>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&& 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)
>     endif
>HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform