Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #6358 > unrolled thread
| Started by | SteveMcNaughton <stevemcnaughton@auditron.com> |
|---|---|
| First post | 2013-12-08 08:25 -0800 |
| Last post | 2013-12-11 14:52 -0800 |
| Articles | 13 — 8 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
Intedrupting a looping process SteveMcNaughton <stevemcnaughton@auditron.com> - 2013-12-08 08:25 -0800
Re: Intedrupting a looping process JohnMartens <martens@tennishulp.info> - 2013-12-08 17:36 +0100
Re: Intedrupting a looping process SteveMcNaughton <stevemcnaughton@auditron.com> - 2013-12-08 20:58 -0800
Re: Intedrupting a looping process D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2013-12-09 06:51 +0100
Re: Intedrupting a looping process Mathias <mathias.hakansson@consultec.se> - 2013-12-09 00:09 -0800
Re: Intedrupting a looping process "Willie Moore" <williem@wmconsulting.com> - 2013-12-09 08:24 -0600
Re: Intedrupting a looping process "Jamal" <someone@example.com> - 2013-12-09 16:24 -0500
Re: Intedrupting a looping process SteveMcNaughton <stevemcnaughton@auditron.com> - 2013-12-09 20:39 -0800
Re: Intedrupting a looping process "Paul D B" <pdb@NOMORESPAMhnt.be> - 2013-12-10 16:25 +0100
Re: Intedrupting a looping process JohnMartens <martens@tennishulp.info> - 2013-12-10 17:51 +0100
Re: Intedrupting a looping process "Jamal" <someone@example.com> - 2013-12-10 12:28 -0500
Re: Intedrupting a looping process dlzc <dlzc1@cox.net> - 2013-12-10 11:24 -0800
Re: Intedrupting a looping process SteveMcNaughton <stevemcnaughton@auditron.com> - 2013-12-11 14:52 -0800
| From | SteveMcNaughton <stevemcnaughton@auditron.com> |
|---|---|
| Date | 2013-12-08 08:25 -0800 |
| Subject | Intedrupting a looping process |
| Message-ID | <c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com> |
I want to interrupt a DO loop processing records without having a progress window if possible. It is an archiving process that literally take days to run for some of my old time clients.
I'd like to inject a change of status for a logic variable from a push button if possible. I don't want the progress window as I think it will slow down an already long process.
I'm having a bad case of programmer's blank stare. Any Ideas?
Loop logic...
Do while ! EOF
... process records
... short circuit those not meeting criteria
... archive found records in supporting databases
... delete affected records
... flag affected records
... CHECK FOR USER INTERRUPTION
... skip to next record
enddo
Here's the code at the end of the loop. just need to set the trigger.
IF SELF:lInterrupt
IF Confirm(SELF, "User Interrupted Process!", "You should pack the database after the interruption to avoid processing the same records again." + crlf+crlf;
+"Are you sure that you want to end the process at this point?")
EXIT
ENDIF
ENDIF
oServer:Skip()
ENDDO
Thanks. Steve.
[toc] | [next] | [standalone]
| From | JohnMartens <martens@tennishulp.info> |
|---|---|
| Date | 2013-12-08 17:36 +0100 |
| Message-ID | <l8275c$p4$1@dont-email.me> |
| In reply to | #6358 |
Do not know what your queatsion is but in this case I would say
Do while (! EOF) .and. (! self:lInterupt)
... process records
... short circuit those not meeting criteria
... archive found records in supporting databases
... delete affected records
... flag affected records
IF SELF:lInterrupt
IF ! Confirm(SELF, "User Interrupted Process!", "You should ...")
SELF:lInterrupt := FALSE
ENDIF
ENDIF
... skip to next record
enddo
John
SteveMcNaughton schreef op 8-12-2013 17:25:
> I want to interrupt a DO loop processing records without having a progress window if possible. It is an archiving process that literally take days to run for some of my old time clients.
>
> I'd like to inject a change of status for a logic variable from a push button if possible. I don't want the progress window as I think it will slow down an already long process.
>
> I'm having a bad case of programmer's blank stare. Any Ideas?
>
> Loop logic...
>
> Do while ! EOF
> ... process records
> ... short circuit those not meeting criteria
> ... archive found records in supporting databases
> ... delete affected records
> ... flag affected records
> ... CHECK FOR USER INTERRUPTION
> ... skip to next record
> enddo
>
> Here's the code at the end of the loop. just need to set the trigger.
> IF SELF:lInterrupt
> IF Confirm(SELF, "User Interrupted Process!", "You should pack the database after the interruption to avoid processing the same records again." + crlf+crlf;
> +"Are you sure that you want to end the process at this point?")
> EXIT
> ENDIF
> ENDIF
> oServer:Skip()
> ENDDO
>
> Thanks. Steve.
>
[toc] | [prev] | [next] | [standalone]
| From | SteveMcNaughton <stevemcnaughton@auditron.com> |
|---|---|
| Date | 2013-12-08 20:58 -0800 |
| Message-ID | <7e6bda33-1066-4688-847e-b131925517f7@googlegroups.com> |
| In reply to | #6358 |
Thanks John. The logic is not the issue. I wrote all the code and it's all working, but it's just taking too damn long to process, so I want to give the user a "live" button to hit to interrupt (cancel) the process. The button would just set the Self:lInterrupt variable and the loop logic would kill it at the bottom of the loop. I don't want it to happen anywhere else. Hope that explains it better. Steve.
[toc] | [prev] | [next] | [standalone]
| From | D.J.W. van Kooten <vankooten@removethis.ic2.com> |
|---|---|
| Date | 2013-12-09 06:51 +0100 |
| Message-ID | <ojmaa914k5n2444ajihn071agmbvcdnsvf@4ax.com> |
| In reply to | #6358 |
On Sun, 8 Dec 2013 08:25:28 -0800 (PST), SteveMcNaughton <stevemcnaughton@auditron.com> wrote: Hello Steve, >I want to interrupt a DO loop processing records without having a progress window if possible. Just add a ApplicationExec (EXECWHILEEVENT) in your code. You could then display a progress bar and it will react on an Abort button which it won't do without the ApplicationExec (EXECWHILEEVENT). Dick
[toc] | [prev] | [next] | [standalone]
| From | Mathias <mathias.hakansson@consultec.se> |
|---|---|
| Date | 2013-12-09 00:09 -0800 |
| Message-ID | <fd66bc50-4968-4ce1-8bbb-8cd7dbd25868@googlegroups.com> |
| In reply to | #6358 |
Hi Steve, If you don't want to show a progress bar, where do you want to have your stop button? In a tray application? In a separate small control application? Third option (remote controlled)? In all these cases you have to use some kind of semaphore to give a stop signal. If it's a window in the same process it's easy (just a variable). If it's not in the same process you have to do something else, like a mutex, registry key, special database record, special text file, environment variable, windows messaging, or something else outside of your worker process. Some of the semaphores I mentioned above will significantly slow down your process if you check them on every iteration. The solution to this is obvious. Only check once every ten, hundred och thousand iterations, depending on how fast you want it to react and how long time an iteration takes. /Mathias Den söndagen den 8:e december 2013 kl. 17:25:28 UTC+1 skrev SteveMcNaughton: > I want to interrupt a DO loop processing records without having a progress window if possible. It is an archiving process that literally take days to run for some of my old time clients. > > > > I'd like to inject a change of status for a logic variable from a push button if possible. I don't want the progress window as I think it will slow down an already long process. > > > > I'm having a bad case of programmer's blank stare. Any Ideas? > > > > Loop logic... > > > > Do while ! EOF > > ... process records > > ... short circuit those not meeting criteria > > ... archive found records in supporting databases > > ... delete affected records > > ... flag affected records > > ... CHECK FOR USER INTERRUPTION > > ... skip to next record > > enddo > > > > Here's the code at the end of the loop. just need to set the trigger. > > IF SELF:lInterrupt > > IF Confirm(SELF, "User Interrupted Process!", "You should pack the database after the interruption to avoid processing the same records again." + crlf+crlf; > > +"Are you sure that you want to end the process at this point?") > > EXIT > > ENDIF > > ENDIF > > oServer:Skip() > > ENDDO > > > > Thanks. Steve.
[toc] | [prev] | [next] | [standalone]
| From | "Willie Moore" <williem@wmconsulting.com> |
|---|---|
| Date | 2013-12-09 08:24 -0600 |
| Message-ID | <l84jqn$5bq$1@speranza.aioe.org> |
| In reply to | #6358 |
Steve,
I have done this with my VO web apps that has a back end processor. The way
I handled it was to have an admin page on my web site that I can restart my
poller. When the user hits the reset button, I simply change a field in a
table on my SQL server. At the end of each cycle, I check the value of the
SQL table and stop the loop if it has been set to true.
Regards,
Willie
Vulcan VIP
"SteveMcNaughton" wrote in message
news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com...
I want to interrupt a DO loop processing records without having a progress
window if possible. It is an archiving process that literally take days to
run for some of my old time clients.
I'd like to inject a change of status for a logic variable from a push
button if possible. I don't want the progress window as I think it will
slow down an already long process.
I'm having a bad case of programmer's blank stare. Any Ideas?
Loop logic...
Do while ! EOF
... process records
... short circuit those not meeting criteria
... archive found records in supporting databases
... delete affected records
... flag affected records
... CHECK FOR USER INTERRUPTION
... skip to next record
enddo
Here's the code at the end of the loop. just need to set the trigger.
IF SELF:lInterrupt
IF Confirm(SELF, "User Interrupted Process!", "You should pack the
database after the interruption to avoid processing the same records
again." + crlf+crlf;
+"Are you sure that you want to end the process at this point?")
EXIT
ENDIF
ENDIF
oServer:Skip()
ENDDO
Thanks. Steve.
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <someone@example.com> |
|---|---|
| Date | 2013-12-09 16:24 -0500 |
| Message-ID | <l85cd4$d1o$1@speranza.aioe.org> |
| In reply to | #6358 |
Suggestion: assuming you subclassed your app class object, add an EXPORT
variable, for example EXPORT lStopLongProcess.
Now in your program menu, create a menu option, that opens a dialog window
with a button set has the following:
GetAppObject():lStopLongProcess := TRUE
then in the DO WHILE, check for GetAppObject():lStopLongProcess = TRUE, and
act upon it.
After exit, reset to false.
This acts like a a GLOBAL variable.
HTH,
Jamal
"SteveMcNaughton" wrote in message
news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com...
I want to interrupt a DO loop processing records without having a progress
window if possible. It is an archiving process that literally take days to
run for some of my old time clients.
I'd like to inject a change of status for a logic variable from a push
button if possible. I don't want the progress window as I think it will
slow down an already long process.
I'm having a bad case of programmer's blank stare. Any Ideas?
Loop logic...
Do while ! EOF
... process records
... short circuit those not meeting criteria
... archive found records in supporting databases
... delete affected records
... flag affected records
... CHECK FOR USER INTERRUPTION
... skip to next record
enddo
Here's the code at the end of the loop. just need to set the trigger.
IF SELF:lInterrupt
IF Confirm(SELF, "User Interrupted Process!", "You should pack the
database after the interruption to avoid processing the same records
again." + crlf+crlf;
+"Are you sure that you want to end the process at this point?")
EXIT
ENDIF
ENDIF
oServer:Skip()
ENDDO
Thanks. Steve.
[toc] | [prev] | [next] | [standalone]
| From | SteveMcNaughton <stevemcnaughton@auditron.com> |
|---|---|
| Date | 2013-12-09 20:39 -0800 |
| Message-ID | <821d561d-a42e-40d7-b444-42e7a83ffcab@googlegroups.com> |
| In reply to | #6365 |
Thanks Jamal and all. I sort of tried this one, but not exactly. I'll give this a twirl, then resort to the progress bar and just pay any time penalty there since the user can get out when they have to safely. Seemed like it should be a slam dunk to me before trying it!! Damn reality always getting in the way of good product design! ;) Steve On Monday, December 9, 2013 4:24:03 PM UTC-5, Jamal wrote: > Suggestion: assuming you subclassed your app class object, add an EXPORT > > variable, for example EXPORT lStopLongProcess. > > Now in your program menu, create a menu option, that opens a dialog window > > with a button set has the following: > > GetAppObject():lStopLongProcess := TRUE > > then in the DO WHILE, check for GetAppObject():lStopLongProcess = TRUE, and > > act upon it. > > > > After exit, reset to false. > > > > This acts like a a GLOBAL variable. > > > > HTH, > > Jamal > > > > > > > > > > "SteveMcNaughton" wrote in message > > news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com... > > > > I want to interrupt a DO loop processing records without having a progress > > window if possible. It is an archiving process that literally take days to > > run for some of my old time clients. > > > > I'd like to inject a change of status for a logic variable from a push > > button if possible. I don't want the progress window as I think it will > > slow down an already long process. > > > > I'm having a bad case of programmer's blank stare. Any Ideas? > > > > Loop logic... > > > > Do while ! EOF > > ... process records > > ... short circuit those not meeting criteria > > ... archive found records in supporting databases > > ... delete affected records > > ... flag affected records > > ... CHECK FOR USER INTERRUPTION > > ... skip to next record > > enddo > > > > Here's the code at the end of the loop. just need to set the trigger. > > IF SELF:lInterrupt > > IF Confirm(SELF, "User Interrupted Process!", "You should pack the > > database after the interruption to avoid processing the same records > > again." + crlf+crlf; > > +"Are you sure that you want to end the process at this point?") > > EXIT > > ENDIF > > ENDIF > > oServer:Skip() > > ENDDO > > > > Thanks. Steve
[toc] | [prev] | [next] | [standalone]
| From | "Paul D B" <pdb@NOMORESPAMhnt.be> |
|---|---|
| Date | 2013-12-10 16:25 +0100 |
| Message-ID | <l87boq$hnm$1@dont-email.me> |
| In reply to | #6367 |
doesn't have to be a progressbar, even a simple "Cancel?" yes/no window with an hourglass would do the trick. Paul "SteveMcNaughton" schreef in bericht news:821d561d-a42e-40d7-b444-42e7a83ffcab@googlegroups.com... Thanks Jamal and all. I sort of tried this one, but not exactly. I'll give this a twirl, then resort to the progress bar and just pay any time penalty there since the user can get out when they have to safely. Seemed like it should be a slam dunk to me before trying it!! Damn reality always getting in the way of good product design! ;) Steve On Monday, December 9, 2013 4:24:03 PM UTC-5, Jamal wrote: > Suggestion: assuming you subclassed your app class object, add an EXPORT > > variable, for example EXPORT lStopLongProcess. > > Now in your program menu, create a menu option, that opens a dialog window > > with a button set has the following: > > GetAppObject():lStopLongProcess := TRUE > > then in the DO WHILE, check for GetAppObject():lStopLongProcess = TRUE, > and > > act upon it. > > > > After exit, reset to false. > > > > This acts like a a GLOBAL variable. > > > > HTH, > > Jamal > > > > > > > > > > "SteveMcNaughton" wrote in message > > news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com... > > > > I want to interrupt a DO loop processing records without having a progress > > window if possible. It is an archiving process that literally take days > to > > run for some of my old time clients. > > > > I'd like to inject a change of status for a logic variable from a push > > button if possible. I don't want the progress window as I think it will > > slow down an already long process. > > > > I'm having a bad case of programmer's blank stare. Any Ideas? > > > > Loop logic... > > > > Do while ! EOF > > ... process records > > ... short circuit those not meeting criteria > > ... archive found records in supporting databases > > ... delete affected records > > ... flag affected records > > ... CHECK FOR USER INTERRUPTION > > ... skip to next record > > enddo > > > > Here's the code at the end of the loop. just need to set the trigger. > > IF SELF:lInterrupt > > IF Confirm(SELF, "User Interrupted Process!", "You should pack the > > database after the interruption to avoid processing the same records > > again." + crlf+crlf; > > +"Are you sure that you want to end the process at this point?") > > EXIT > > ENDIF > > ENDIF > > oServer:Skip() > > ENDDO > > > > Thanks. Steve
[toc] | [prev] | [next] | [standalone]
| From | JohnMartens <martens@tennishulp.info> |
|---|---|
| Date | 2013-12-10 17:51 +0100 |
| Message-ID | <l87gq8$hrp$1@dont-email.me> |
| In reply to | #6368 |
A progress window with a ft control that (once every x loops) shows progress can hardly be the problem in case of speed Paul D B schreef op 10-12-2013 16:25: > doesn't have to be a progressbar, even a simple "Cancel?" yes/no window > with an hourglass would do the trick. > > Paul > > "SteveMcNaughton" schreef in bericht > news:821d561d-a42e-40d7-b444-42e7a83ffcab@googlegroups.com... > > Thanks Jamal and all. > > I sort of tried this one, but not exactly. I'll give this a twirl, then > resort to the progress bar and just pay any time penalty there since the > user can get out when they have to safely. > > Seemed like it should be a slam dunk to me before trying it!! Damn > reality always getting in the way of good product design! ;) > > Steve > > > On Monday, December 9, 2013 4:24:03 PM UTC-5, Jamal wrote: >> Suggestion: assuming you subclassed your app class object, add an EXPORT >> >> variable, for example EXPORT lStopLongProcess. >> >> Now in your program menu, create a menu option, that opens a dialog >> window >> >> with a button set has the following: >> >> GetAppObject():lStopLongProcess := TRUE >> >> then in the DO WHILE, check for GetAppObject():lStopLongProcess = >> TRUE, and >> >> act upon it. >> >> >> >> After exit, reset to false. >> >> >> >> This acts like a a GLOBAL variable. >> >> >> >> HTH, >> >> Jamal >> >> >> >> >> >> >> >> >> >> "SteveMcNaughton" wrote in message >> >> news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com... >> >> >> >> I want to interrupt a DO loop processing records without having a >> progress >> >> window if possible. It is an archiving process that literally take >> days to >> >> run for some of my old time clients. >> >> >> >> I'd like to inject a change of status for a logic variable from a push >> >> button if possible. I don't want the progress window as I think it will >> >> slow down an already long process. >> >> >> >> I'm having a bad case of programmer's blank stare. Any Ideas? >> >> >> >> Loop logic... >> >> >> >> Do while ! EOF >> >> ... process records >> >> ... short circuit those not meeting criteria >> >> ... archive found records in supporting databases >> >> ... delete affected records >> >> ... flag affected records >> >> ... CHECK FOR USER INTERRUPTION >> >> ... skip to next record >> >> enddo >> >> >> >> Here's the code at the end of the loop. just need to set the trigger. >> >> IF SELF:lInterrupt >> >> IF Confirm(SELF, "User Interrupted Process!", "You should pack the >> >> database after the interruption to avoid processing the same records >> >> again." + crlf+crlf; >> >> +"Are you sure that you want to end the process at this point?") >> >> EXIT >> >> ENDIF >> >> ENDIF >> >> oServer:Skip() >> >> ENDDO >> >> >> >> Thanks. Steve >
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <someone@example.com> |
|---|---|
| Date | 2013-12-10 12:28 -0500 |
| Message-ID | <l87ivg$3uq$1@speranza.aioe.org> |
| In reply to | #6367 |
If you need further help, please ask. I'll give you a working sample. Jamal "SteveMcNaughton" wrote in message news:821d561d-a42e-40d7-b444-42e7a83ffcab@googlegroups.com... Thanks Jamal and all. I sort of tried this one, but not exactly. I'll give this a twirl, then resort to the progress bar and just pay any time penalty there since the user can get out when they have to safely. Seemed like it should be a slam dunk to me before trying it!! Damn reality always getting in the way of good product design! ;) Steve On Monday, December 9, 2013 4:24:03 PM UTC-5, Jamal wrote: > Suggestion: assuming you subclassed your app class object, add an EXPORT > > variable, for example EXPORT lStopLongProcess. > > Now in your program menu, create a menu option, that opens a dialog window > > with a button set has the following: > > GetAppObject():lStopLongProcess := TRUE > > then in the DO WHILE, check for GetAppObject():lStopLongProcess = TRUE, > and > > act upon it. > > > > After exit, reset to false. > > > > This acts like a a GLOBAL variable. > > > > HTH, > > Jamal > > > > > > > > > > "SteveMcNaughton" wrote in message > > news:c1a36b59-16d7-4e59-b30f-9479f0e718bf@googlegroups.com... > > > > I want to interrupt a DO loop processing records without having a progress > > window if possible. It is an archiving process that literally take days > to > > run for some of my old time clients. > > > > I'd like to inject a change of status for a logic variable from a push > > button if possible. I don't want the progress window as I think it will > > slow down an already long process. > > > > I'm having a bad case of programmer's blank stare. Any Ideas? > > > > Loop logic... > > > > Do while ! EOF > > ... process records > > ... short circuit those not meeting criteria > > ... archive found records in supporting databases > > ... delete affected records > > ... flag affected records > > ... CHECK FOR USER INTERRUPTION > > ... skip to next record > > enddo > > > > Here's the code at the end of the loop. just need to set the trigger. > > IF SELF:lInterrupt > > IF Confirm(SELF, "User Interrupted Process!", "You should pack the > > database after the interruption to avoid processing the same records > > again." + crlf+crlf; > > +"Are you sure that you want to end the process at this point?") > > EXIT > > ENDIF > > ENDIF > > oServer:Skip() > > ENDDO > > > > Thanks. Steve
[toc] | [prev] | [next] | [standalone]
| From | dlzc <dlzc1@cox.net> |
|---|---|
| Date | 2013-12-10 11:24 -0800 |
| Message-ID | <d8632b2f-de03-4855-bfd8-3eb52ab04ad8@googlegroups.com> |
| In reply to | #6358 |
Dear SteveMcNaughton: On Sunday, December 8, 2013 9:25:28 AM UTC-7, SteveMcNaughton wrote: ... > I'd like to inject a change of status for a > logic variable from a push button if possible. > I don't want the progress window as I think it > will slow down an already long process. How about running the same program again, and part of its initialization code is a check to see if it is already running? You can then research the window handle, command Windoze to terminate the earlier instance, and terminate this one after you get success. David A. Smith
[toc] | [prev] | [next] | [standalone]
| From | SteveMcNaughton <stevemcnaughton@auditron.com> |
|---|---|
| Date | 2013-12-11 14:52 -0800 |
| Message-ID | <f33ca0bc-40f5-491c-b37a-cf4ede1201ef@googlegroups.com> |
| In reply to | #6358 |
I finally decided to use the progress bar with cancel button since I already had it present in the system, subclassed and packaged so the coding was pretty simple. I haven't quantified the time penalty as I just ran a small test loop. That's next. Thanks for all the ideas though. I haven't been coding much in the last 6 months like I used to, and got a bit rusty! Blowing off the dust and diving into some large projects so you might see me around... :) Was glad to see some of the names of those I remember from the past. Greetings. I see I have some catching up to do! Steve
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web