Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Russell Hill
  Where is Russell Hill?
 Sydney
 Australia
 Russell Hill
 Tags
Subject: RE: Listboxes looping
Thread ID: 228609 Message ID: 228647 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: XML
Date: Wednesday, May 20, 2009 12:18:27 PM         
   


Hi Russell,

> I've found when using ShellExecute that I need to place Messageboxes in places to make sure the bat file processing is actually finished before moving on. Otherwise the first process hasn't finished when the second begins. That prompts my question in this case.
>

You can implement a "run and wait" sequence via CreateProcess(), OpenProcess, WaitForSingleObject() and related API functions.
IIRC, there are a few related downloads at www.universalthread.com, Downloads section, "Run And Wait", "Api_Apprun" etc.

Or, if you can make sure that WSH is always available, try WScript.Shell Run():
Local loShell As WScript.Shell, lnSuccess
loShell = CREATEOBJECT('WScript.Shell')
lnSuccess = loShell.Run('calc',1,.T.) && the 3rd one is the "Wait" parameter
Return (m.lnSuccess = 0)




hth
-Stefan



> Hi all,
>
> I have several related ListBoxes with a small number of items in each.
>
> The first LB will never have more than 12 items, the second never more than 10 and the third never more than 20.
>
> I have been testing some XML parsing using the XML DOM from the Click() event of each ListBox.
>
> I'm now happy with the parsing but, since they are all related, I want to loop through the ListBoxes making repeated SOAP calls and parsing the XML response from each web service.
>
> What happens is this: the selected item in the first LB determines the items in the second LB and the selected item in the second LB determines the items in the third LB.
>
> I have written the appropriate code to loop through the items in each LB until the last item in the first LB.
>
> This seems to work fine but I still have a question.
>
> Is there a possiblity that these repeated Clicks will "get ahead" of the XML responses?
>
> If so, do I need to put some sort of "wait" in the code somewhere to guard against this?
>
> I've found when using ShellExecute that I need to place Messageboxes in places to make sure the bat file processing is actually finished before moving on. Otherwise the first process hasn't finished when the second begins. That prompts my question in this case.
>
> Thanks,
>
> Russell.

ENTIRE THREAD

Listboxes looping Posted by Russell Hill @ 5/20/2009 10:13:42 AM
RE: Listboxes looping Posted by Stefan Wuebbe @ 5/20/2009 12:18:27 PM
RE: Listboxes looping Posted by Russell Hill @ 5/20/2009 1:38:00 PM