Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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#?

  • *Experts*
Posted

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 to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...