ph_varsub PowerHome formula function
Description
Use this function to enable or disable
variable
substitution.
Syntax
ph_varsub ( value
)
Argument |
Description |
value
|
Integer. Use 0 to turn off variable
substitution. Use any other value to turn variable
substitution on.
|
Return value
Integer.
Returns 0.
Usage
Variable substitution is typically
performed on all formulas before they are executed. Using variable notation such
as [LOCAL1] and {TEMP} within your formula and variable substitution enabled
will cause PowerHome to search the formula and replace the [LOCAL1] notation
with the actual value contained in LOCAL1 and {TEMP} will be replaced with the
actual value contained with the TEMP global variable. Disabling variable
substitution will cause this variable notation to NOT be substituted and will
instead be interpreted literally.
Disabling variable substitution will
have the benefit of making PowerHome a little more efficient and faster. Without
having to do a search and replace on every formula prior to execution, you will
recover precious CPU cycles. If you do disable variable substitution, you can
use the ph_getvar_X and ph_getglobal_X functions to utilize global and system
variables within
your formulas.
Examples
The following examples demonstrate typical syntax/usage for this function.
ph_varsub(1)
The above example will
enable variable
substitution.