GadgetGuy Super User
Joined: June 01 2008 Location: United States
Online Status: Offline Posts: 942
|
Posted: May 14 2013 at 06:42 | IP Logged
|
|
|
PROGRAMMING TIP
There are times when one wants to disable All Trigger
Events or Timed Events for the duration of a critical
macro, so that the macro is not impacted.
This is equivalent to turning Interrupts on/off in a
real-time system, when a time/state critical operation is
being executed and must not be interfered with.
At this time (May 2013) there are no PH commands to
disable/enable all Triggers, but the same result may be
obtained using the following PH Direct SQL formulas . . .
(Enables all Triggers)
Code:
ph_directsql("update triggers set status = 1")
|
|
|
(Disables all Triggers)
Code:
ph_directsql("update triggers set status = 0")
|
|
|
To similarly Enable/Disable Timed Events, use the
ph_timedeventsctrl function.
To Disable all Timed Events, you would use:
Code:
ph_timedeventsctrl(“off”,0) |
|
|
And to Enable all Timed Events (and execute past
due
events) use:
Code:
ph_timedeventsctrl(“on”,1) |
|
|
Whenever Triggers or Events are Disabled, be SURE to re-
enable them ASAP as soon as done. If these functions are
ever left Disabled, your PH functionality will pretty
much cease!
It is probably a good programming practice to always
Enable both Triggers and Events in your PH Initialization
routines.
Edited by GadgetGuy - May 14 2013 at 08:04
__________________ Ken B - Live every day like it's your last. Eventually, you'll get it right!
|