Function digit(bin As uLong,n As uByte) ' Return a specified digit from a number ' Params: ' bin - the number to process ' n - the digit (0 being rightmost digit) to extract ' Returns: ' a ubyte containing the digit ' Dim result As uByte n = n + 1 Repeat n bin,result = divmod(bin,10) End Repeat End Function result