Before midnight "Seconds() < nDone" will be false in this case.

Maybe (untested):

... nDone := (Seconds() + iif( nTimeout >= 0, nTimeout, 0 ) )
...
... Seconds() + iif( nDone > MS_PERDAY, MS_PERDAY, 0) < nDone

April

> Date: Fri, 29 Jan 2010 11:13:23 -0800
> From: [email protected]
> To: [email protected]
> Subject: [Harbour] Re: 24 hour wait loop in telephaty
> 
> 
> will this fix it?
> 
> 
> #define MS_PERDAY   (24*60*60*60*60)
> 
> nDone := (Seconds() + iif( nTimeout >= 0, nTimeout, 0 ) ) % MS_PERDAY
> 
> 
> 
> 
> 
> AbeB wrote:
> > 
> > Hi All,
> > 
> > 
> > these lines (and similar ones) in contrib\hbtpathy\telepath.prg
> > will cause in to wait 24 hours if executed before midnight.
> > 
> > 
> > 
> >    nDone := Seconds() + iif( nTimeout >= 0, nTimeout, 0 )
> > 
> >    DO WHILE tp_OutFree( nPort ) > 0 .AND. ;
> >          ( nTimeout < 0 .OR. Seconds() < nDone )
> >       hb_IdleState()
> >    ENDDO
> > 
> > how can this be fixed?
> > any ideas?
> > 
> > thanks,
> > Abe
> > 
> > 
> > 
> > 
> -- 
> View this message in context: 
> http://n2.nabble.com/24-hour-wait-loop-in-telephaty-tp4481630p4481850.html
> Sent from the harbour-devel mailing list archive at Nabble.com.
> _______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> [email protected]
> http://lists.harbour-project.org/mailman/listinfo/harbour
                                          
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to