ph_ismacrowaiting PowerHome formula function
Description
Checks whether the specified macro is currently in a wait state
Syntax
ph_ismacrowaiting ( )
ph_ismacrowaiting ( as_macro )
Argument | Description |
as_macro | String (Optional). The ID of the macro to
check for a waiting status. If this parameter is omitted, the system variable MACRO will be used |
Return value
Long. Returns the number of macros waiting that match the specified ID. If no macros match the ID, then 0 is returned
Usage
Use this function to check if a macro is
currently waiting or not. A typical usage would be to execute this function
from within a macro to check if that macro is currently waiting or not. If it
isnt waiting, continue with processing. If it is waiting, either kill the
waiting macro or extend the wait time of the waiting macro. In this use case
scenario, you can use the syntax that does not include the as_macro parameter as
the currently executing macro ID will be in the MACRO
system variable
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_ismacrowaiting("SPRINKLERCYCLE")
- Returns 1 (or possibly more) if the SPRINKLERCYCLE is currently in the macro
wait
queue
• ph_ismacrowaiting() -
Returns the number of entries in the macro wait queue for the macro ID that this
function was executed from. This ID would be the value in the system variable
MACRO