G
Guest
Why doesn’t this work? If State="NY", the resulting IF statement returns 31,
if the State="NC" the resulting IF returns -27, yet NC is in the array list.
Its random as to which stats work and which do not. AL will return 0, but AR
will return -3, yet its in the list. I know the value when neg (-) is a
bitwise representation, but most every state in the array list returns a neg
number, Why?
string[] strStateArray = new string[]
{"AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IN","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","DC","WV","WI","WY"};
if(Array.BinarySearch(strStateArray, State.ToString())<0)
{
ValidationStatus="Incoming State is invalid. The follow state
abrevations are acceptable: " + strStateArray.ToString();
}
if the State="NC" the resulting IF returns -27, yet NC is in the array list.
Its random as to which stats work and which do not. AL will return 0, but AR
will return -3, yet its in the list. I know the value when neg (-) is a
bitwise representation, but most every state in the array list returns a neg
number, Why?
string[] strStateArray = new string[]
{"AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IN","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","DC","WV","WI","WY"};
if(Array.BinarySearch(strStateArray, State.ToString())<0)
{
ValidationStatus="Incoming State is invalid. The follow state
abrevations are acceptable: " + strStateArray.ToString();
}