The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



BoolToNumArray


Unit:SDL_openarrays
Class: none
Declaration: [1] function BoolToNumArray (Src: TBoolArray; FalseValue, TrueValue: integer; var Dst: TIntArray): integer;
[2] function BoolToNumArray (Src: TBoolArray; FalseValue, TrueValue: double; var Dst: TDoubleArray): integer;
[3] function BoolToNumArray (Src: TBool2DArray; FalseValue, TrueValue: integer; var Dst: TInt2DArray): integer;
[4] function BoolToNumArray (Src: TBool2DArray; FalseValue, TrueValue: double; var Dst: TDouble2DArray): integer;

The function BoolToNumArray converts the boolean array Src into a dichotomous numeric array 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 array.

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

The function returns the following error codes:

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



Last Update: 2018-Aug-01