ph_extendmacrowait PowerHome formula function
Description
Extends the amount of wait time for a macro which is currently in a wait state.
Syntax
ph_extendmacrowait ( ad_seconds, ai_type )
ph_extendmacrowait ( as_macro, ad_seconds, ai_type )
Argument |
Description |
as_macro
|
String (Optional). The ID of the waiting macro. If this
parameter is omitted, the system variable MACRO will be used for the ID
|
ad_seconds
|
Double . The number of seconds to extend the wait. Fractions of a second can be represented in decimal format.
|
ai_type
|
Integer . The method of extending the wait. A 0 will extend the macro wait time from the time this function is executed. Any other value will extend the wait from the time the macro is currently set to expire.
|
Return value
Integer. Returns a 0
if the macro wait time was successfully extended. Returns a 1 if the specified macro ID is not waiting or an error occurs.
Usage
Use this function to extend the wait time of a macro that is currently waiting (Initiated by the Macro command "Wait"). If multiple macros with the same ID are waiting, this command will only extend the wait time of the oldest waiting macro. Extending the wait time of a macro does not effect its status as the oldest waiting macro. Typically this function would be used in conjunction with the ph_ismacrowaiting function to first check if a macro is waiting and then either waiting or extending the wait of a currently waiting macro so as not to have more than 1 macro of the same ID waiting.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_extendmacrowait("DELAY",5.5,1) -
Extends the wait time of the DELAY macro by an additional 5.5 seconds
from when it is currently set to
expire