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.

How to fire a routine at an interval time

Xailer professional forum in English
Responder
Milan Mehta
Mensajes: 140
Registrado: Dom Dic 27, 2009 9:54 am

How to fire a routine at an interval time

Mensaje por Milan Mehta »

I need to fire a function at an interval of time (say 5 seconds) till a condition is met.

For example, when the user Presses a button called "Payment", I need to check the status of the payment every 5 seconds till I get the reply "Success" or maximum 10 times whichever is first.

How can I ?

TIA

Milan Mehta.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9399
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Re: How to fire a routine at an interval time

Mensaje por ignacio »

Hi,

Use a timer. Five seconds its a nInterval of 5000. For example:

Código: Seleccionar todo

oTimer := TTimer():Create( oForm, 5000, {|| CheckPayment() } )
Inside the CheckPayment function you can easily control the iterations. Important: DO NOT FORGET TO DESTROY DE TIMER.

Regards,
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder