Synchronization of events: Question. 
Author Message
 Synchronization of events: Question.

Hi Again Folks...

Consider the following code sample...

        for n=1 to 9
             thisform.commandbutton.click
        endfor

I've discovered this will cause 9 consecutive click events.

However, I would like the iteration of the 'for...endfor'  loop to wait on an outcome of the click event.  That is, have it behave
more like this...

        for n=1 to 9
             do myproce
        endfor  

        proc myproc
            ? 'n='+str(n)
            wait
        endproc

...where the loop iteration waits on a return from myproc.

Is there a way to accomplish this?
Ron Picker
DharmaSystems

Druid Hollow
French Creek, WV.



Sat, 22 Jul 2000 03:00:00 GMT  
 Synchronization of events: Question.

Ron,

First, your code does NOT cause click events, it does run the click method
of the button.  These are two different things in that a click event is
caused by clicking the mouse button.

Secondly to get what you want try this;

LOCAL lxDummy
 for n=1 to 9
      lxDummy = thisform.commandbutton.click()
 endfor

This will cause the call to the click method to wait for a return before the
loop continues

JimB

Quote:

>Hi Again Folks...

>Consider the following code sample...

> for n=1 to 9
>      thisform.commandbutton.click
> endfor

>I've discovered this will cause 9 consecutive click events.

>However, I would like the iteration of the 'for...endfor'  loop to wait on

an outcome of the click event.  That is, have it behave
Quote:
>more like this...

> for n=1 to 9
>      do myproce
> endfor

> proc myproc
>     ? 'n='+str(n)
>     wait
> endproc

>...where the loop iteration waits on a return from myproc.

>Is there a way to accomplish this?
>Ron Picker
>DharmaSystems

>Druid Hollow
>French Creek, WV.



Sat, 22 Jul 2000 03:00:00 GMT  
 Synchronization of events: Question.

Hi Jim:

Thanks for the correction and the suggestion.

I tried your suggestion, but in effect it exexcutes the same as my original loop...executing the click method 9 times without
waiting for a return.

Ron

Quote:

>Ron,
>First, your code does NOT cause click events, it does run the click method
>of the button.  These are two different things in that a click event is
>caused by clicking the mouse button.
>Secondly to get what you want try this;
>LOCAL lxDummy
> for n=1 to 9
>      lxDummy = thisform.commandbutton.click()
> endfor
>This will cause the call to the click method to wait for a return before the
>loop continues
>JimB

>>Hi Again Folks...

>>Consider the following code sample...

>> for n=1 to 9
>>      thisform.commandbutton.click
>> endfor

>>I've discovered this will cause 9 consecutive click events.

>>However, I would like the iteration of the 'for...endfor'  loop to wait on
>an outcome of the click event.  That is, have it behave
>>more like this...

>> for n=1 to 9
>>      do myproce
>> endfor

>> proc myproc
>>     ? 'n='+str(n)
>>     wait
>> endproc

>>...where the loop iteration waits on a return from myproc.

>>Is there a way to accomplish this?
>>Ron Picker
>>DharmaSystems

>>Druid Hollow
>>French Creek, WV.



Sun, 23 Jul 2000 03:00:00 GMT  
 Synchronization of events: Question.

Hi Jim:

Thanks for the correction and the suggestion.

I tried your suggestion, but in effect it exexcutes the same as my original loop...executing the click method 9 times without
waiting for a return.

Ron

Quote:

>Ron,
>First, your code does NOT cause click events, it does run the click method
>of the button.  These are two different things in that a click event is
>caused by clicking the mouse button.
>Secondly to get what you want try this;
>LOCAL lxDummy
> for n=1 to 9
>      lxDummy = thisform.commandbutton.click()
> endfor
>This will cause the call to the click method to wait for a return before the
>loop continues
>JimB

>>Hi Again Folks...

>>Consider the following code sample...

>> for n=1 to 9
>>      thisform.commandbutton.click
>> endfor

>>I've discovered this will cause 9 consecutive click events.

>>However, I would like the iteration of the 'for...endfor'  loop to wait on
>an outcome of the click event.  That is, have it behave
>>more like this...

>> for n=1 to 9
>>      do myproce
>> endfor

>> proc myproc
>>     ? 'n='+str(n)
>>     wait
>> endproc

>>...where the loop iteration waits on a return from myproc.

>>Is there a way to accomplish this?
>>Ron Picker
>>DharmaSystems

>>Druid Hollow
>>French Creek, WV.



Sun, 23 Jul 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Synchronization of events: Question.

2. Color synchronization problem in report and print preview

3. Database synchronization problem

4. synchronization problem with SQL server

5. VFP timer process synchronization

6. ODBC / Oracle synchronization

7. VFP7 - Need advice on replication and synchronization

8. Event driven - question.

9. 2 questions - Killing a form - The Unload Event

10. KeyPress Event Question, and Determining Which Form is Visible

11. When Event in VFP 5.0 question

12. click event question

 

 
Powered by phpBB® Forum Software