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....



SelectRandomBit


Unit: SDL_dstruct
Class: TBitFld
Declaration: function SelectRandomBit (PreCondition: boolean): integer;

The function SelectRandomBit randomly selects a bit showing the state defined by PreCondition. If PreCondition is TRUE the random selection is performed among the TRUE bits, else one of the FALSE bits is selected.

The function returns the index of the selected bit (0 to Size) or a value of -1 if no bit of the given precondition is available.



Last Update: 2023-Feb-06