Using The First Argument As Switch Flag
The first input argument to the function can play a special role as a switch flag that controls whether the function is executed or not.
Using the first argument in this way is preferable to using the Excel built-in formula IF(b,ds(...),c), where ds(...) runs if b is TRUE, otherwise the constant c is returned.
It works as follows:
If it is a boolean equal to TRUE, the function runs processes the remaining arguments only and returns the calculated result.
If it is a boolean equal to FALSE, the function ignores all remaining arguments and simply returns the old data that happen to exist in the function's output range.
If it is a single value equalling either some text starting with the hash sign # or some number, the function ignores all remaining arguments and simply returns that single value.
More seldom used, the first argument may also contain the special text *InputAsText* or *InputAsText_OuterTrimmed*, that instructs Deriscope to initially parse all input data as if they were pure text, with the second case also resulting in the trimming of all leading and trailing white spaces of these data.
Be careful to enter the special text exactly as it appears here, including the special prefix and suffix characters *
This seldom used functionality may be of interest when input data such a "2/6/23" or "0.03" need to be interpreted as text tokens rather than date and number respectively.
If the first argument is already used as a switch flag, then the second argument may carry the special text mentioned above.
Below is a list of 6 advantages associated with using the first argument as described above against using the Excel built-in formula IF(b,ds(...),c).
Turning the first argument to FALSE, the function still returns the previous output.
This is very useful if the reason for using FALSE is to avoid recalculating a time consuming function all the time, but still want to keep the previously calculated output visible and accessible on the spreadsheet.
One could achieve the same by using the circular Excel built-in formula IF(b,ds(...),Address), where Address is the address of the cell containing the formula.
The problem is that this formula is circular and leads to error, except if one changes Excel's global options to allow for iterative calculations.
The latter is nevertheless not advisable as it affects Excel's global behavior and may lead to undetected wrong output in formulas that involve unintended circular dependencies.
When the cell containing the ds formula is selected, the user can use the Import/Export button as described in
Enhanced spreadsheet readability and maintenance since IF(b,ds(...),c) is a composite function consisting of the outer function IF() conditionally calling the inner function ds() and therefore more complex than a single function ds()