Вы можете использовать делегата:
Public Function LessThan(Of T As IComparable)(ByVal A As T, ByVal B As T) As Boolean
Return A.CompareTo(B) < 0
End Function
Public Function GreaterThan(Of T AS IComparable)(ByVal A As T, ByVal B As T) As Boolean
Return A.CompareTo(B) > 0
End Function
Dim comparer As Func(Of Integer,Integer,Boolean) = AddressOf GreaterThan(Of Integer)
If myVar Then comparer = AddressOf LessThan(Of Integer)
Do While comparer(X,Y)
''#call Method A
''#the values of X and Y will change within this loop
Loop
Конечно, для этого нужен VS2008. Для большего удовольствия:
Do While CBool(Y.CompareTo(Y) * -1) = myVar
''#...
End While