I have a timer working in the background, which is checking for new
messages in table1 -every 30 minutes. If at the same time somebody
preview a report with more than 1 page and is trying to change page -
report preview is disappearing....:-(
I know it's because timer is changing current cursor (reports are used
public dataenvironment), so i try to disable timer before report shows
and enable after - works OK , but in this case if user will open any
report in <30 min will never get messages prepared by timer...

Is there a way to store curent "time to fire" of timer so it could
start not from 0 ?
Or maybe somebody have better idea how to get rid of this report
behavior ? (I don't want to change it to use private dataenvironment)

Thanks,
Adam

Re: timer and report with >1 page by Christian

Christian
Mon Feb 06 23:31:26 CST 2006

Hi,

this should work:

yourTimer:Timer()
&& set autoyield to .F. top make sure no code triggered by user
&& interaction can run while in this method
_VFP.AutoYield = .F.

&& save current alias
LOCAL lcAlias
lcAlias = ALIAS()

&& do your stuff

&& restore alias
IF !EMPTY(lcAlias)
SELECT &lcAlias
ENDIF

&& restore autoyield to default
_VFP.AutoYield = .T.


Regards
Christian

Re: timer and report with >1 page by adam

adam
Tue Feb 07 22:50:33 CST 2006

That was it !
Thanks a lot for your help. I've never used this AutoYield property
before...

Adam