Index progress bar
Moderator: Rathinagiri
Index progress bar
In the good old Clipper days i used an progress bar function (NtxBar) for indexing (0% to 100%). Here a Clipper code snippet:
INDEX ON &cNdxExpr TAG (cNdxName) UNIQUE FOR !Deleted() TO (cDbfName) eval NtxBar(aStat) every (aStat[4])
Now i like to accomplisch the same in HMG, but I'm stuck.
The goal is to use a modal window in the main window showing a 0% to 100% status bar during the indexing process.
See in the attachment my coding result until now. Two problems:
1. The indicator is not showing the right lenght. When the counter is 100% the progressbar is at 95%. The progress bar seems to delay 5% but the value (nX) is the same ! Strange, why ?
2. How to implement this progressbar in an eval() function (can be used in index on ... )
Or is there a simpler \ smarter way to create a progress bar in a modal window ? Somebody else has got a good indexing progress bar example ?
INDEX ON &cNdxExpr TAG (cNdxName) UNIQUE FOR !Deleted() TO (cDbfName) eval NtxBar(aStat) every (aStat[4])
Now i like to accomplisch the same in HMG, but I'm stuck.
The goal is to use a modal window in the main window showing a 0% to 100% status bar during the indexing process.
See in the attachment my coding result until now. Two problems:
1. The indicator is not showing the right lenght. When the counter is 100% the progressbar is at 95%. The progress bar seems to delay 5% but the value (nX) is the same ! Strange, why ?
2. How to implement this progressbar in an eval() function (can be used in index on ... )
Or is there a simpler \ smarter way to create a progress bar in a modal window ? Somebody else has got a good indexing progress bar example ?
- Attachments
-
- ProgressBar.zip
- Demo file
- (1.08 KiB) Downloaded 352 times
- serge_girard
- Posts: 3169
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Index progress bar
Theo,
Your PRG seems OK to me. See att.
I will search for EVAL sample.
Serge
Your PRG seems OK to me. See att.
I will search for EVAL sample.
Serge
- Attachments
-
- 100.png (2.31 KiB) Viewed 12256 times
-
- 95.png (2.59 KiB) Viewed 12256 times
There's nothing you can do that can't be done...
- serge_girard
- Posts: 3169
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Index progress bar
Theo,
Found this: (in my samples)
I haven't tested this myself
Serge
Found this: (in my samples)
Code: Select all
...
nRecsDone := 0
FORM_CONTACT.Progress_1.Value := nRecsDone
USE Tipos ALIAS Tipos EXCLUSIVE
nLastRec := LastRec()
INDEX ON STR(Cod_Tipo, 3) TAG Cod_Tipo
INDEX ON HMG_Upper(Desc) TAG Desc
REINDEX EVAL {|| InProgress(nLastRec) } EVERY 10
....
Function InProgress(nLastRec)
nRecsDone := nRecsDone + 10
FORM_CONTACT.Progress_1.Value := ( nRecsDone/nLastRec ) * 100
hb_IdleSleep( 0.2 ) // When dbf is too big, pls cut off this
Return .T.
Serge
There's nothing you can do that can't be done...
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Index progress bar
The progress bar is nice but unnecessary, in this case "L'art pour l'art"
I think it would be useful to show how the table is indexed
For example, there are 10 tables, 15 index, then to count from 1 to 15 and to show the progress bar and possibly write the name of the tables and indexes
I think it would be useful to show how the table is indexed
For example, there are 10 tables, 15 index, then to count from 1 to 15 and to show the progress bar and possibly write the name of the tables and indexes
- serge_girard
- Posts: 3169
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Index progress bar
Maybe true, maybe not.
Nature of the question was not aesthetical or arty but technical!
S
Nature of the question was not aesthetical or arty but technical!
S
There's nothing you can do that can't be done...
Re: Index progress bar
Hi Serge,
Thanks again for your help !
I tried both HMG 3.4.0 and 3.4.2 and both show me:
Strange because the nX value is the same. Do you use another compiler ?
Serge wrote:"Your PRG seems OK to me. See att."
Thanks again for your help !
I tried both HMG 3.4.0 and 3.4.2 and both show me:
Strange because the nX value is the same. Do you use another compiler ?
Last edited by trmpluym on Sun Feb 28, 2016 11:31 am, edited 2 times in total.
Re: Index progress bar
For small indexes it is. But for large indexes it informs the user what is happening so the don't think the program is 'frozen'.dragancesu wrote:The progress bar is nice but unnecessary, in this case "L'art pour l'art"
indexes
I like to see a progress bar per index. So for 10 tables with 15 indexes. I like to see 15 index progress indicators (one by one after eachother) processing from 0% to 100%. More clear ?dragancesu wrote: I think it would be useful to show how the table is indexed
For example, there are 10 tables, 15 index, then to count from 1 to 15 and to show the progress bar and possibly write the name of the tables and indexes
Last edited by trmpluym on Sun Feb 28, 2016 11:36 am, edited 1 time in total.
- serge_girard
- Posts: 3169
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Index progress bar
Theo,
I use HMG3.4.2 on W7 PC.
Serge
I use HMG3.4.2 on W7 PC.
Serge
There's nothing you can do that can't be done...
Re: Index progress bar
Hmm, strange mine is also HMG3.4.2 on W7. I will send you my EXE in a PM. Gan you give it a try ?serge_girard wrote:Theo,
I use HMG3.4.2 on W7 PC.
Serge
- serge_girard
- Posts: 3169
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact: