A strang request, and operator through a variable?
Not sure how to ask this question exactly, so here goes....Is there a way in .NET to use an operator as a variable, for example, instead of saying...
VB Code:
sOperator = "="
Select Case sOperator
Case "="
If sExpression1 = sExpression2 Then
'do something
End If
Case "<="
If sExpression1 <= sExpression2 Then
'do something
End If
Case ">="
If sExpression1 >= sExpression2 Then
'do something
End If
Case "<"
If sExpression1 < sExpression2 Then
'do something
End If
Case ">"
If sExpression1 > sExpression2 Then
'do something
End If
Case "<>"
If sExpression1 <> sExpression2 Then
'do something
End If
End Select
do something like this...
VB Code:
sOperator = "="
If sExpression1 sOperator sExpression2 Then
'do something for every situation
End If
Now I know trying to do it exactly how I've written it here doesn't work, but you should get my point. Is there a way anyone has used before to utilize this same functionality? What I'm trying to do is provide different conditions to the user, and making the operator selectable for themt.
Any ideas and/or opinions are welcomed.
Thanks!
Sibby