Re: [VB6 ] 長久以來的疑惑

看板Visual_Basic作者 (么柏)時間16年前 (2008/03/11 01:10), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
: 推 beyonds999:Integer 也是兩個byte 03/10 19:28 那個比較有道理,我反而覺得C的int 跟 long 都 4 Bytes 極詭異 反正寫VB因為Integer太小不會沒顧慮到溢位 查了Wiki ,似乎Boolean就是Integer Boolean constant True has numeric value -1 . This is because the Boolean data type is stored as a 16-bit signed integer. In this construct -1 evaluates to 16 binary 1s (the Boolean value True), and 0 as 16 0s (the Boolean value False). This is apparent when performing a Not operation on a 16 bit signed integer value 0 which will return the integer value -1 , in other words True = Not False. This inherent functionality becomes especially useful when performing logical operations on the individual bits of an integer such as And, Or, Xor and Not. This definition of True is also consistent with BASIC since the early 1970s Microsoft BASIC implementation and is also related to the characteristics of microprocessor instructions at the time. -- ┬ ██ ██ ██ ██◣ ████◣ ████◣ ◢███▍┌┤ ┼┼ ◥█ ██◤ ██ ██ ██ ██◣ ██ ██◣ ██▄▄▄▄ ┼┐ ◢█ ██◣ ██ ██ ██ ██ ██ ██ ▄▄▄▄██ ┌┤ ┌┼ ██ ██ █████◤ █████◤ █████◤ █████◤ 歡迎大家來 開個人版喔 telnet://XDBBS.twbbs.org or telnet://ACGer.tw -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.112.40.3
文章代碼(AID): #17rMkXzR (Visual_Basic)
文章代碼(AID): #17rMkXzR (Visual_Basic)