Congrats with the new updated and upgraded more spacious home for the forum.
Creating the program which checks some changes in the files ones per few seconds. The method I used as a first attempt kind of failing so I decided to use another one which employs timer control %dl . But it is also failing. Here is demo. Try to run it. Initially it works. It calls some function every second as it was preset and updates and displays the number of calls. But try to change the default interval time - no effect.
(Comment: I use recursive function just for additional safety: it has no effect in this specific demo but could be useful when the computer becomes very slow and due to that the timer will issue the call for the next such function while it is still not finished with the previous call - this will lead to crash)
module PICrunControl
integer LastPICfileOutputNumber
integer (7) hwFileCheckingInterval
real*8 :: FileCheckingInterval = 1
contains
integer recursive function FileCheckingCB ()
LastPICfileOutputNumber = LastPICfileOutputNumber + 1
call window_update@(LastPICfileOutputNumber)
FileCheckingCB = 2
end function FileCheckingCB
!...................................
integer function changeTimerDelay ()
call CHANGE_TIMER_INTERVAL@(hwFileCheckingInterval, FileCheckingInterval)
changeTimerDelay = 2
end function
end module
!=============================================
Program Prog
use PICrunControl
k = WINIO@('Interval %ta%df%rf%ff&', 1d0, FileCheckingInterval )
k = WINIO@('Caii number %ta%4rd%ff&', LastPICfileOutputNumber )
k = WINIO@('%dl&', FileCheckingInterval, FileCheckingCB)
k = WINIO@('%hw%es', hwFileCheckingInterval)
end