In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
METHOD ASYNC Btn1Click( oSender ) CLASS TForm1
...
AWAIT INLINE {||
FOR nFor := 1 TO 100
Sleep(10)
SYNCHRO INLINE {|| ::oPb1:nValue := nFor }
NEXT
RETURN "Exit from first serie"
}
// lastAwait is a private VAR with the return value of previous Await command
AWAIT INLINE {||
SYNCHRO INLINE { || Msginfo( lastWait ) }
RETURN NIL
}
RETURN NIL
LOCAL oFuture AS CLASS TFuture
LOCAL oTask AS CLASS TFutureTask
LOCAL bWork
LOCAL nFor
oFuture := TFuture():New()
bWork := { ||
FOR nFor := 1 TO 100
Sleep(30)
oFuture:AddSynchroTask( {||::oPb3:nValue := nFor } )
NEXT
RETURN "Exit from third serie"
}
oFuture:OnComplete := {|| Msginfo( oTask:ReturnValue ) }
oTask := oFuture:AddThreadTask( bWork )
RETURN Nil