BoolToNumVector

Declaration: BoolToNumVector (Src: TBoolArray; FalseValue, TrueValue: double; var Dst: TDoubleArray): integer;
The function BoolToNumVector converts the boolean vector Src into a dichotomous numeric vector Dst. Each cell of the Dst array will either be filled by the value FalseValue or by TrueValue, depending on the state of the corresponding cell of the Src vector.

The size of the vector Dst will be automatically adjusted to fit the size of the vector Src.

The function returns the following error codes:

 0 ... everything is OK, Dst contains the numeric values
-1 ... Src vector has no length


Last Update: 2018-Aug-01