gpt4 book ai didi

vb.net - VB 2010 中的 Select Case 的多个条件

转载 作者:行者123 更新时间:2023-12-03 00:37:46 24 4
gpt4 key购买 nike

我试图弄清楚如何测试案例陈述中的两个条件。

Select Case txtWeight.Text
Case Is <= 2
decShippingCost = (decShipping2 + (decShipping2 * 0.26))
Case Is > 2 and <= 4
decShippingCost = (decShipping4 + (decShipping4 * 0.026))

我无法开始工作,我做错了什么?

最佳答案

Select Case txtWeight.Text
Case Is <= 2
decShippingCost = (decShipping2 + (decShipping2 * 0.26))
Case 3 to 4
decShippingCost = (decShipping4 + (decShipping4 * 0.026))
End Select

或者如果你想将 2.5 捕获为 >2,也可以这样。

Select Case txtWeight.Text
Case Is <= 2
decShippingCost = (decShipping2 + (decShipping2 * 0.26))
Case 2.01 to 4
decShippingCost = (decShipping4 + (decShipping4 * 0.026))
End Select

关于vb.net - VB 2010 中的 Select Case 的多个条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9968579/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com