Function to ensure variables have same value or null

Shaitan00

Junior Contributor
Joined
Aug 11, 2003
Messages
358
Location
Hell
Given 3 variables [var1, var2, var3], which represent the version [i.e.: 1, 2, 3, etc.] of each station.

I need a method/function to ensure that the version is the same in all stations that are reporting. So if the value [varX] is blank/null then do not count it in the comparisons, otherwise ensure all filled variables are the same.

I am looking for a way to check this without going threw case/select statements [first thing that comes to mind] for each possible case [when a variable is null].
Of course in reality there are 22 variables, which explains why I cannot do the trivial Case/Select for all possibilities of null variables.

Anyone have a better idea on how to code the pseudo-code above in VC#?
 
What are you comparing the values to? Are you saying that each individual check needs only occur if both values are non-null? Would you want to stop comparison if any one of the comparisons failed?

-Ner
 
I want the function to return TRUE or FALSE [boolean] regarding the comparaison.

So I want it to check to see if the non-null variables have the same value.

So if Var1=1, Var2=2, Var3= "" then it would return false [Var1 != Var2]. However is Var1=2, Var2="", and Var3=2 then it would return TRUE because the non-null vars are the same.
 
Back
Top