Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #5177 > unrolled thread
| Started by | "Philippe Bayard (Belgium)" <philbayard@gmail.com> |
|---|---|
| First post | 2013-04-30 02:33 -0700 |
| Last post | 2013-05-14 05:08 -0700 |
| Articles | 6 — 3 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
AppendDB & Progress Bar - Source server stays open "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2013-04-30 02:33 -0700
Re: AppendDB & Progress Bar - Source server stays open "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2013-04-30 02:52 -0700
Re: AppendDB & Progress Bar - Source server stays open Massimo Bighelli <info@arcasistemi.it> - 2013-04-30 19:51 +0200
Re: AppendDB & Progress Bar - Source server stays open "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2013-04-30 03:45 -0700
Re: AppendDB & Progress Bar - Source server stays open "Heiko J. Pongratz" <heiko.pongratz@ctsedv.de> - 2013-04-30 13:58 +0200
Re: AppendDB & Progress Bar - Source server stays open "Philippe Bayard (Belgium)" <philbayard@gmail.com> - 2013-05-14 05:08 -0700
| From | "Philippe Bayard (Belgium)" <philbayard@gmail.com> |
|---|---|
| Date | 2013-04-30 02:33 -0700 |
| Subject | AppendDB & Progress Bar - Source server stays open |
| Message-ID | <dfb10093-a819-43b0-9370-8f288ded82ec@googlegroups.com> |
Hi everyone,
i'm having some trouble to display a progress bar during an appendDB.
In my windows i have this code :
self:oDCMaxRecord:value := nbRecord1 //Number of records in source file
self:oDCProgressBar1:value := 1
self:Max := nbRecord1
if self:Max >100000
self:istep := self:Max / 1000 // Refresh every nStep records
self:oDCProgressBar1:Range := Range{1,1000}
elseif self:Max / 100 > 0
self:istep := self:Max / 100
self:oDCProgressBar1:Range := Range{1,100}
else
self:istep := 1
self:oDCProgressBar1:Range := Range{1,self:Max}
endif
ftdbf := Path + FileName
cbEval :={||FUpdateProg(oself)} // Updating code
if ! oserv:appenddb(ftdbf,,,cbEval,, "DBFCDX" ,)
DebugLog("Unable to append")
ENDIF
With the function used in my code block:
Function FUpdateProg(oself)
if oself:nrecords % oself:istep == 0
oself:oDCProgressBar1:Advance(1)
if oself:nrecords < oself:Max
oself:odcNbRecord:value := AsString(oself:nrecords)
else
oself:odcNbRecord:value := AsString(oself:Max)
return false
endif
oself:odcpourcentage:value := AsString(Round((oself:nrecords/oself:Max)*100,0))+"%"
elseif oself:nrecords >= oself:Max
return false
endif
oself:nrecords := oself:nrecords +1
ApplicationExec(EXECWHILEEVENT) // rgtr 090508
RETURN true
The problem is that when my appendDB is done with true as return value, the source server ftdbf remains opens and i cannot delete it and i cant close it.
Am it doing something wrong?
I even try to just do
Function FUpdateProg(oself)
ApplicationExec(EXECWHILEEVENT) // rgtr 090508
RETURN true
But it does the same.
Does someone have any idea?
[toc] | [next] | [standalone]
| From | "Philippe Bayard (Belgium)" <philbayard@gmail.com> |
|---|---|
| Date | 2013-04-30 02:52 -0700 |
| Message-ID | <82b4e3bc-a7d1-4571-92d7-b86fb70ae76b@googlegroups.com> |
| In reply to | #5177 |
For information,when i just do Function FUpdateProg(oself) RETURN true The source file is closed normally. Seems like the ApplicationExec isn't a good idea...
[toc] | [prev] | [next] | [standalone]
| From | Massimo Bighelli <info@arcasistemi.it> |
|---|---|
| Date | 2013-04-30 19:51 +0200 |
| Message-ID | <klp0bk$mr8$1@speranza.aioe.org> |
| In reply to | #5179 |
Il 30/04/2013 11:52, Philippe Bayard (Belgium) ha scritto: > For information,when i just do > > Function FUpdateProg(oself) > RETURN true > > The source file is closed normally. > Seems like the ApplicationExec isn't a good idea... > this I don't understand... ApplicationExec is INSIDE FUpdateProg() if this is OK, it's not ApplicationExec the problem... maybe the codeblock? try do not pass the server object via codeblock, instead pass the string name, create/open/close it in your function *Massimo Bighelli* ARCA Sistemi S.r.l.
[toc] | [prev] | [next] | [standalone]
| From | "Philippe Bayard (Belgium)" <philbayard@gmail.com> |
|---|---|
| Date | 2013-04-30 03:45 -0700 |
| Message-ID | <6bbdf7e8-d66c-4fa4-91a8-545373b86f13@googlegroups.com> |
| In reply to | #5177 |
Well it's that applicationExec who made it happens. If i remove it , it works right but i cant get the hand on the screen during the copy... I don't understand...
[toc] | [prev] | [next] | [standalone]
| From | "Heiko J. Pongratz" <heiko.pongratz@ctsedv.de> |
|---|---|
| Date | 2013-04-30 13:58 +0200 |
| Message-ID | <klobff$s59$1@dont-email.me> |
| In reply to | #5181 |
Phillipe, I can´t really explain why the ApplicationExec locks your file. But usually the parameter that you are using for the refreshing of the display is for the while-condition codeblock. SO what you do is a bit tricky and maybe not allowed :-) But a possible solution for your problem would be to write an own appenddb method. This wouldn´t be too difficult, because you don´t need to implement all parameters from the original method and you only use a few... Greetings Heiko "Philippe Bayard (Belgium)" <philbayard@gmail.com> schrieb im Newsbeitrag news:6bbdf7e8-d66c-4fa4-91a8-545373b86f13@googlegroups.com... > Well it's that applicationExec who made it happens. If i remove it , it > works right but i cant get the hand on the screen during the copy... > > I don't understand...
[toc] | [prev] | [next] | [standalone]
| From | "Philippe Bayard (Belgium)" <philbayard@gmail.com> |
|---|---|
| Date | 2013-05-14 05:08 -0700 |
| Message-ID | <87080b51-b272-4887-a6e7-33035630d3e4@googlegroups.com> |
| In reply to | #5177 |
Thanks for the answers I think i'll rewrite de AppendDB in my way as suggested. Phil.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web