Bit mask error codes
Posted on 2009-05-15
We have an application that returns error code data as bit mapped.
1 - error 1
2 - error 2
4 - error 3
8 - error 4
16 error 5
If the app returne either a 1,2,4,8... I kow the error, but more oft than not it is a combination of errors ie
9 - error 1 and error 4.
Does anyone have an algorithm to convert these decimals back ito the error codes. I have a list of codes.
Ideally I'd like to do this on SQL Server, but code behind would be ok.