我连续一遍又一遍地使用相同的功能,有没有办法像
with basicmove()
{(r),(u, 20),(r)
end with
代替
basicmove(r)
basicmove(u, 20)
basicmove(r)
编辑:或
basicmove(l, 5)
basicmove(d, 3)
basicmove(l, 21)
basicmove(u, 5)
最佳答案
不,这不可能。但是如果参数是相同类型的,你可以使用基本类型和 List.ForEach
的列表。或普通 For Each
环形:
moves.ForEach(Function(r) basicmove(r))
您可以创建一个具有适当属性和
List(Of Move)
的新类。 .
关于vb.net - 在 vb.net 中是否有类似于 "with"的东西,但对于函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27986656/