How to write 2 statements that differ just by Operator type in VB.NET
- by Richard Bysouth
Hi
I have the following code sample, where the only difference between the 2 parts of the If statement is the less than/greater than operators.
Is there a better way to write this? Could almost do with being able to define an Operator variable.
If myVar = true Then
Do While (X < Y)
'call Method A
Loop
Else
Do While (X > Y)
'call Method A
Loop
End If
thanks