DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


SelectRandomBit

Declaration:TBitFld.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.