Public Function IsGoodLongToRGBHex() As Boolean
' verify correct LongToRGBHex returns
' returns True if all tests are passed
  Dim fFailed As Boolean
  
  ' replace "LongToRGBHex05" with the name of your function to test
  If LongToRGBHex05(12) <> "0C0000" Then Stop: fFailed = True
  If LongToRGBHex05(825580) <> "EC980C" Then Stop: fFailed = True
  If LongToRGBHex05(&H87654321) <> "214365" Then Stop: fFailed = True
  If LongToRGBHex05(&HFFFF&) <> "FFFF00" Then Stop: fFailed = True
  If LongToRGBHex05(&HFFFFFFFF) <> "FFFFFF" Then Stop: fFailed = True
  If LongToRGBHex05(&H80000000) <> "000000" Then Stop: fFailed = True
  If LongToRGBHex05(&H80008000) <> "008000" Then Stop: fFailed = True
  If LongToRGBHex05(0) <> "000000" Then Stop: fFailed = True
  
  ' well done
  IsGoodLongToRGBHex = Not fFailed

End Function


Back to LongToRGBHex