什么's VBA和Javascript布尔表达式之间的区别

What's the difference between VBA and Javascript boolean expressions?

本文关键字:布尔表达式 Javascript 之间 区别 VBA 什么      更新时间:2023-12-09

在JavaScript中:

alert(True > False) -> true
alert(False > True) -> false

这是有道理的,因为True是1,False是0。。

但在VBA中:

Msgbox(4 > 3)        -> true
Msgbox(True > False) -> false
Msgbox(False > True) -> true

有人能解释一下原因吗?

在VBA中,True为-1,False为0。:)所以所有的方程式都是对的。请参阅上一个问题:如果值=true,则在VBA 中附加1 else 0