Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.clipper.visual-objects

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 10-19-2011, 11:04 AM
Martin
Guest
 
Posts: n/a
Default Waiting in a program

Hello

I need to allow the program to idle while in a loop to allow another
screen within the executable to be switched to.

DO WHILE TRUE
// some code including the exit

// wait state allowing control
ENDDO

If certain conditions are triggered I need to stall this loop and go to
another screen in the same application and do something there.

ApplicationExec(EXECWHILEEVENT) and Sleep() both don't work in this
instance.

Any ideas please?
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 10-19-2011, 12:50 PM
Willie Moore
Guest
 
Posts: n/a
Default Re: Waiting in a program

Martin,

Have you considered when the condition is true and you need to start another
window to do it modally?

Regards,
Willie

"Martin" wrote in message news:H8ynq.2787$Bc7.1793@newsfe20.ams2...

Hello

I need to allow the program to idle while in a loop to allow another
screen within the executable to be switched to.

DO WHILE TRUE
// some code including the exit

// wait state allowing control
ENDDO

If certain conditions are triggered I need to stall this loop and go to
another screen in the same application and do something there.

ApplicationExec(EXECWHILEEVENT) and Sleep() both don't work in this
instance.

Any ideas please?

Reply With Quote
  #3 (permalink)  
Old 10-19-2011, 01:33 PM
Martin
Guest
 
Posts: n/a
Default Re: Waiting in a program

The other task will not be a modal window, but will be another open
window in the application.

I am looking at a quick fix to a fatal embrace locking situation in a
number of places, quite a big rewrite on a saving routine to avoid it.

This is not a permanent fix, the rewrite is, this is just so the user
can change window and exit it while waiting for a lock.

Happens occasionally at 2 sites or so, but I may want the switchable
lock wait code for other uses.

On 19/10/2011 13:50, Willie Moore wrote:
> Martin,
>
> Have you considered when the condition is true and you need to start
> another window to do it modally?
>
> Regards,
> Willie
>
> "Martin" wrote in message news:H8ynq.2787$Bc7.1793@newsfe20.ams2...
>
> Hello
>
> I need to allow the program to idle while in a loop to allow another
> screen within the executable to be switched to.
>
> DO WHILE TRUE
> // some code including the exit
>
> // wait state allowing control
> ENDDO
>
> If certain conditions are triggered I need to stall this loop and go to
> another screen in the same application and do something there.
>
> ApplicationExec(EXECWHILEEVENT) and Sleep() both don't work in this
> instance.
>
> Any ideas please?


Reply With Quote
  #4 (permalink)  
Old 10-19-2011, 01:46 PM
dlzc
Guest
 
Posts: n/a
Default Re: Waiting in a program

Dear Martin:

On Oct 19, 4:04*am, Martin <s...@spam.spam> wrote:
> Hello
>
> I need to allow the program to idle while in a
> loop to allow another screen within the executable
> to be switched to.
>
> DO WHILE TRUE
> // some code including the exit
>
> // wait state allowing control
> ENDDO
>
> If certain conditions are triggered I need to
> stall this loop and go to another screen in
> the same application and do something there.
>
> ApplicationExec(EXECWHILEEVENT) and Sleep()
> both don't work in this instance.
>
> Any ideas please?


How about

DO WHILE inkey(0.1) = 0
ENDDO
.... with your choice of redirector based on keystroke?

David A. Smith
Reply With Quote
  #5 (permalink)  
Old 10-19-2011, 02:07 PM
Stephen Quinn
Guest
 
Posts: n/a
Default Re: Waiting in a program

Martin

Is this program controlled or user controlled??

If user then it's really out of your control as windows will set focus to
whatever window/control is clicked.
I program control then in your loop
if condition_tested_for_is_true
// Abort what I'm doing in this loop
// Set focus to the other window
// Do whatever on that window and return here once it's done and
// hope like hell that the user didn't do something to these windows
// before I get back here
endif

How do you know that 'other' window will even be open??
Will/can it be minimised??
Do you expect to pass data into the 'other' window??

Why can't you have the current window do whatever it is you want done??

CYA
Steve


Reply With Quote
  #6 (permalink)  
Old 10-19-2011, 02:54 PM
Martin
Guest
 
Posts: n/a
Default Re: Waiting in a program

See my reply to Willie

It is so control can pass to another window in the application while
processing pauses in another.



On 19/10/2011 15:07, Stephen Quinn wrote:
> Martin
>
> Is this program controlled or user controlled??
>
> If user then it's really out of your control as windows will set focus to
> whatever window/control is clicked.
> I program control then in your loop
> if condition_tested_for_is_true
> // Abort what I'm doing in this loop
> // Set focus to the other window
> // Do whatever on that window and return here once it's done and
> // hope like hell that the user didn't do something to these windows
> // before I get back here
> endif
>
> How do you know that 'other' window will even be open??
> Will/can it be minimised??
> Do you expect to pass data into the 'other' window??
>
> Why can't you have the current window do whatever it is you want done??
>
> CYA
> Steve
>
>


Reply With Quote
  #7 (permalink)  
Old 10-24-2011, 09:37 PM
Jamal
Guest
 
Posts: n/a
Default Re: Waiting in a program

Martin,

DoEvents() in your loop designed for this purpose. Basically it allows
multi-tasking while other events are working.

Jamal



"Martin" wrote in message news:QwBnq.35$1Y4.2@newsfe18.ams2...

See my reply to Willie

It is so control can pass to another window in the application while
processing pauses in another.



On 19/10/2011 15:07, Stephen Quinn wrote:
> Martin
>
> Is this program controlled or user controlled??
>
> If user then it's really out of your control as windows will set focus to
> whatever window/control is clicked.
> I program control then in your loop
> if condition_tested_for_is_true
> // Abort what I'm doing in this loop
> // Set focus to the other window
> // Do whatever on that window and return here once it's done and
> // hope like hell that the user didn't do something to these
> windows
> // before I get back here
> endif
>
> How do you know that 'other' window will even be open??
> Will/can it be minimised??
> Do you expect to pass data into the 'other' window??
>
> Why can't you have the current window do whatever it is you want done??
>
> CYA
> Steve
>
>


Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 05:44 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.