/* Groupes de discussion : dbase.programming De : Romain Strieff [dBVIPS] Date : 2000/07/26 Objet : Re: CreateIndex In article <8ln5o0$gd...@news.dbase2000.com>, Trevor Drake-Brockman politely paraphrased > Just starting to use version 7.5 > Is there a way to display a progress bar for a indexing operation. I have > adapted the createreindex.prg which works well to recreate the index files > but there does not seem to be a way to update a progress bar from the index > creation. I could use a function call from the index expression or for > clause but this means the it will get call when adding or changing data and > although this is Ok (can ignore if not in reindex program) it means > un-necessary processing. > Is there some hidden option or function that allows the index > function/method to update a index bar. Similar to Clipper's 'Index on .... > Eval progressbar()'. Not the same way, but run all this code below in 1 file to see something similar. */ ** END HEADER -- do not remove this line // // Generated on 05/08/2010 // parameter bModal local f f = new onprogressForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class onprogressForm of FORM with (this) onOpen = class::FORM_ONOPEN open = class::OPEN readModal = class::READMODAL scaleFontBold = false height = 16.0 left = 62.0 top = 0.0 width = 61.8571 text = "www.dbase.free.fr - Demo progressbar indexation" endwith this.TEXT1 = new TEXT(this) with (this.TEXT1) height = 1.0 left = 3.0 top = 1.8182 width = 52.4286 alignVertical = 1 // Middle alignHorizontal = 1 // Center text = "" endwith this.PROGRESS1 = new PROGRESS(this) with (this.PROGRESS1) height = 1.0 left = 3.0 top = 5.0 width = 52.4286 value = 0 rangeMin = 0 rangeMax = 100 endwith this.PROGRESS2 = new PROGRESS(this) with (this.PROGRESS2) height = 1.0 left = 3.0 top = 3.0 width = 52.4286 value = 0 rangeMin = 0 rangeMax = 100 endwith this.TEXT2 = new TEXT(this) with (this.TEXT2) height = 3.0 left = 4.0 top = 8.5 width = 53.0 text = "Groupes de discussion : dbase.programming De : Romain Strieff [dBVIPS] Date : 2000/07/26 Objet : Re: CreateIndex" endwith Function Open if this.CanOpen() return super::open() else return false endif Function ReadModal if this.CanOpen() return super::readmodal() else return false endif Function CanOpen d=_app.databases[1] if not d.tableexists("OnProgress.dbf") create table "OnProgress.dbf"(; f1 char(1),; f2 char(1),; f3 char(1)) use Onprogress.dbf generate 5000 use else use Onprogress.dbf excl do while "" # tag( 1 ) delete tag tag( 1 ) enddo endif return true function form_onOpen _app.session.onProgress = class::onProgress _app.session.form = form use OnProgress excl index on f1 tag f1 form.progress2.value=33 index on f2 tag f2 form.progress2.value=66 index on f3 tag f3 form.progress2.value=100 _app.session.form=null _app.session.onProgress = null form.text1.text="Terminated" return function onProgress( nPercent, msg ) if nPercent >= 0 this.form.progress1.value = nPercent elseif not empty( msg ) this.form.text1.text = msg endif return endclass