在程序中设置一个全局变量例如A,在启动子程序后,设置变量A有值:
IF A<> "" THEN
CALL 子程序
A="YES"
END IF
然后在需要重新启动子程序时或在timer过程中的值不为1的情况下:
A=""
即可。
譬如说你要监控的变量为A,那么再增加一个窗口变量B
dim b as string
if a<>1 then
if b<>"" then
call 子程序
b="yes"
end if
else
b=""
end if
call 子程序后,子程序中将 Timer.Enable 设置为 False
timer中:
static b as boolean
if b and a<>1 then
call xxx
endif
b=a=1