ph_forloop PowerHome formula function
Description
Evaluates a formula expression a specified number of times.
Syntax
ph_forloop ( formula, n, n, n )
Argument |
Description |
formula
|
A string which contains the formula expression you would like to have evaluated.
|
n
|
A double representing the starting value of the for loop.
|
n
|
A double representing the ending value of the for loop.
|
n
|
A double representing the increment value of the for loop.
|
Return value
Integer. Returns a 0 when the loop is completed. If the increment value is 0, then a value of 1 is returned.
Usage
Use the ph_forloop when you want to evaluate a formula a known number of times. The formula will be evaluated as long as the starting value is less than or equal to the ending value if the increment is a positive number. The formula will be evaluated as long as the starting value is greater than or equal to the ending value if the increment is a negative number. With each iteration, the starting value will be adjusted by the increment value.