VB6中布尔False和True的整数值是多少? [英] What are the Integer values of Boolean False and True in VB6?

查看:7
本文介绍了VB6中布尔False和True的整数值是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm working with a bit of old VB6 code that goes thus...

Dim STATUS As Integer

STATUS = -1

If (Not STATUS) Then
' do something
Else
' do something else
End If

so I was, naturally, wondering which branch of this code is executed. So does anyone know what the numeric values of True and False are in VB6?

解决方案

True is stored as -1 and false as 0. Any non-zero value is considered as true.

To see why it is so please check - http://www.vbforums.com/showthread.php?t=405047

这篇关于VB6中布尔False和True的整数值是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆