Timer Property (OpenInsight 64-bit)
At 26 MAY 2022 11:19:51AM Mark Glicksman wrote:
In OI 10.x is there any substitute for the Timer property in a form?
At 26 MAY 2022 11:38AM Andrew McAuley wrote:
You don't need a substitute - as the docs say
"Remarks
In previous versions of OpenInsight only forms supported a TIMER property and a
TIMER event. In this version all GUI objects support them"
The Timer event is exposed in the IDE but not the property. I assume this is an oversight.
World leaders in all things RevSoft
At 26 MAY 2022 11:48AM Mark Glicksman wrote:
Thanks, Andrew. Is there an example on how to use it? I want to execute a procedure once per second as long as the form is running.
At 26 MAY 2022 12:14PM Andrew McAuley wrote:
// Execute the TIMER event once and only once after n millseconds Call Set_Property_Only( CtrlEntID, "TIMER", 0 : @Fm : n ) // Execute the TIMER event every n millseconds starting after n // millseconds Call Set_Property_Only( CtrlEntID, "TIMER", n ) // Execute the TIMER event every n millseconds starting immediately Call Set_Property_Only( CtrlEntID, "TIMER", n : @Fm : 0 ) // Stop generating TIMER events Call Set_Property_Only( CtrlEntID, "TIMER", 0 )World leaders in all things RevSoft
At 26 MAY 2022 01:57PM Mark Glicksman wrote:
Thanks so much, Andrew
At 26 MAY 2022 04:22PM Mark Glicksman wrote:
When I implement a timer event on my start form, I cannot open any other application. Every time the timer event "clicks", it forces focus back to Openinsight. It doesn't matter what the timer event is - even an event that does nothing. Is there any way to overcome this?
At 30 MAY 2022 06:35AM Carl Pates wrote:
Hi Mark,
I can't reproduce this - the IDE itself uses TIMER events which don't have this issue. Can you give me steps to reproduce it please?
Regards
At 31 MAY 2022 11:16AM Mark Glicksman wrote:
I added a timer event to the initial form of my app. It fires once per second to read a short text from an operating system file to determine if the text has changed. I intended this as a substitute for the now defunct DDE capability. Each time the event fires, it grabs the focus away from any other app. This prevents me from doing anything in the CAD app because every second the focus snaps back to the initial form.
At 31 MAY 2022 11:23AM Donald Bakke wrote:
I added a timer event to the initial form of my app. It fires once per second to read a short text from an operating system file to determine if the text has changed. I intended this as a substitute for the now defunct DDE capability. Each time the event fires, it grabs the focus away from any other app. This prevents me from doing anything in the CAD app because every second the focus snaps back to the initial form.
I concur with Carl, this is very odd and unexpected behavior. It seems to me that something else is at work here.
However, you might get better success using the DIRWATCHER control.
At 31 MAY 2022 02:18PM Mark Glicksman wrote:
Thanks, I'll take a look at DIRWATCHER.
At 31 MAY 2022 03:36PM Mark Glicksman wrote:
Don, I added a DIRWATCH control to my startup form. This is what I put into the Create event: Retval = Exec_Method(@Window:".DIRWATCH_1", "WATCHDIR", "C:\bgmapwin\dirwatch", 0, "") Does that look OK?
I am not clear on how to use the CHANGED event for this control. Are there any examples?
Thanks for your help.
At 31 MAY 2022 05:55PM Barry Stevens wrote:
Post removed by author
At 31 MAY 2022 06:10PM Barry Stevens wrote:
Don, I added a DIRWATCH control to my startup form. This is what I put into the Create event: Retval = Exec_Method(@Window:".DIRWATCH_1", "WATCHDIR", "C:\bgmapwin\dirwatch", 0, "") Does that look OK?
I am not clear on how to use the CHANGED event for this control. Are there any examples?
Thanks for your help.
As per the document that Don pointed you to.
The changed event in the @Window:".DIRWATCH_1" control.
Process the 'newdata' values that are passed:
This event is raised when changes have been detected in the monitored directories.
bForward = CHANGED( NewData )
This event passes a single parameter called NewData which contains an @vm-delimited list of changed items (i.e. notifications). Each item in the list comprises an “action code” and the name and path of the affected file, delimited by an @svm.
Action codes are defined in the MSWIN_FILENOTIFY_EQUATES insert record like so:
equ FILE_ACTION_ADDED$ to 0x00000001equ FILE_ACTION_REMOVED$ to 0x00000002equ FILE_ACTION_MODIFIED$ to 0x00000003equ FILE_ACTION_RENAMED_OLD_NAME$ to 0x00000004equ FILE_ACTION_RENAMED_NEW_NAME$ to 0x00000005
At 01 JUN 2022 12:17PM Mark Glicksman wrote:
It worked! Thank you all.