A Macro allows PhixFlow to define and retain functions (macros) can be called repeatedly.
Insert excerpt |
---|
| _standard_settings |
---|
| _standard_settings |
---|
nopanel | true |
---|
|
Field | Description |
---|
Name | The name of the macro. This name is also how the macro will be invoked (called) from elsewhere in PhixFlow |
Minimum Parameters | The minumum number of parameters that must be passed to the macro when it is invoked. |
Maximum Parameters | The maximum number of parameters that may be passed to the macro when it is invoked. |
Expression |
Expression | The script that evaluates to a value based on the input parameters. |
Description |
Description | Optional: a description of the macro. |
...
Code Block |
---|
do(
$val = $args[1],
if( startsWith($val, "."),
// if the cost is positive, add a zero onto the beginning
"0" + $val,
// ELSE
if( startsWith($val, "-."),
//if the cost is negative, replace the -. with a -0.
"-0." + substring($val,3),
//ELSE
$val
)
)
) |
Macros
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 20 |
---|
showSpace | false |
---|
sort | title |
---|
cql | label = "macro" and space = currentSpace ( ) |
---|
|