Or versus OrElse

前端 未结 8 1630
感情败类
感情败类 2020-11-27 04:33

What\'s the difference between or and OrElse?

if temp is dbnull.value or temp = 0

produces the error:

8条回答
  •  余生分开走
    2020-11-27 04:59

    OrElse is short circuited, this means that only one side of the expression will be tested if the first side is a match.

    Just like AndAlso will only test one side of the expression if the first half is a fail.

提交回复
热议问题