ph_formulabtnparm PowerHome formula function
Description
Executes a PowerHome saved formula (PowerHome Explorer->PowerHome->Formulas) with optional parameters.
Syntax
ph_formulabtnparm ( vartype, id, local1, local2, local3, local 4, local5 )
Argument Description
vartype Integer. Determines whether the current set of variables will be updated during the formula evaluation or current variable values will be preserved. Use 0 to update the current set of variables.  Use any other number to preserve the current values.
id String. The ID of the Formula that you'd like to have evaluated.
local1 Any. This value will become the new LOCAL1 value.
local2 Any. This value will become the new LOCAL2 value.
local3 Any. This value will become the new LOCAL3 value.
local4 Any. This value will become the new LOCAL4 value.
local5 Any. This value will become the new LOCAL5 value.
Return value
String. Returns the result of the formula evaluation.
Usage
You can use this function similar to calling a macro with parameters.
Examples
The following examples demonstrate typical syntax/usage for this function.
ph_formulabtnparm(1,"SENDEMAIL","youraddress@email.com","Subject","Message body",0,0)
The above example will execute the SENDEMAIL formula that was previously created in the PowerHome Explorer.  It will set the LOCAL1 thru LOCAL5 variables with LOCAL1 being the address to send email to, LOCAL2 being the subject of the email, and LOCAL3 being the body of the email.  LOCAL4 and LOCAL5 are not needed by the formula so their values are default set to 0.  The first parameter (vartype) of 1 will cause the current variable set to be preserved with no changes occuring to any variables as a result of running the function.