> From: Ken Shmidheiser [mailto:kshmidheiser@...] > John asked: > > >Is it possible to put a handle events in an OPEN "UNIX" do loop? > > > >I would have figured one of the following would have worked, > but they both > >just hang. The point of the handleevents is my indeterminant > progress bar > >won't animate without it. > > > >open "UNIX",2,"cp /somebigfile /anewbigfile" > >do > >a$=inkey$(2) > >handleevents > >until eof(2) > >close 2 > > > >open "UNIX",2,"cp /somebigfile /anewbigfile" > >do > >if lof(2) then line input a$ > >handleevents > >until eof(2) > >close 2 > > > John, > > No time for testing here, but try this as per Alain's suggestion with > a simple modification from me in the earlier New Word Order thread: > > > // In Robert Purves Examples (Donations folder) > Include "Subs PollTime.Incl" > > Fn SetupPollTime( 150, 0 ) > > open "UNIX",2,"cp /somebigfile /anewbigfile" > do > a$=inkey$(2) > Long If Fn PollTime > IdleControls( Window( _wndRef ) ) > Long If System(_sysVers) > 999 > // Do your progress bar animation > // each time Poll Time fires > DrawOneControl( Button&(_progrBtn) ) > FlushWindowBuffer > End If > until eof(2) > close 2 > > > Ken Thanks Ken, but the problem is that inkey$ and loc() don't appear to work with open "UNIX", so your version hangs waiting for the output of the unix command to be flushed and eof() to go true. Since inkey$ never gets anything, eof never becomes true. The only way that I have found to flush the output of the open "UNIX" statement is line input. That is, of course, going to hang until the copy completes. I thought about using "on timer" but it requires handleevents to fire, and that is what I am trying to make happen! John. **************************************************************************** This message contains information which may be confidential and privileged. Unless you are the intended recipient (or authorized to receive this message for the intended recipient), you may not use, copy, disseminate or disclose to anyone the message or any information contained in the message. If you have received the message in error, please advise the sender by reply e-mail, and delete the message. Thank you very much. ****************************************************************************