• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 0、""(空字串)、Null、Empty、與Nothing的區別

    發表于:2007-05-25來源:作者:點擊數: 標簽:字串EmptyNothingNULL區別
    0、""(空字串)、Null、Empty、與 Nothing 的區別 先回答以下問題吧! 經過以下的敘述之后, 變量 A、B、C、D 分別等于 0、 ""、Null、 Empty、 Nothing 的哪一個? Dim A Dim B As String Dim C As Integer Dim D As Object A 等于 Empty, 因為尚未初始化的
    0、""(空字串)、Null、Empty、與 Nothing 的區別
    先回答以下問題吧! 經過以下的敘述之后, 變量 A、B、C、D 分別等于 0、
    ""、Null、 Empty、 Nothing 的哪一個?
    Dim A
    Dim B As String
    Dim C As Integer
    Dim D As Object
    A 等于 Empty, 因為尚未初始化的「不定型變量」都等于 Empty。但如果檢
    測 A = "" 或 A = 0, 也都可以得到 True 值。
    B 等于 "", 因為尚未初始化的非固定長度「字串」都等于 "" 。 但請注意
    B<> Null。
    C 等于 0, 這個還有問題嗎?
    D 等于 Nothing, 尚未設定有物件的「物件變量」都等于 Nothing, 但請不
    要使用 D = Nothing , 而要使用 D Is Nothing 來判斷 D 是否等于 Nothing,
    因為判斷 是否相等的符號是 Is 不是 = 。
    最令人迷惑的地方是 Null 這個保留字, 請看以下語句:
    Print X = Null
    Print X <> Null
    結果都是輸出 Null(不是 True 也不是 False), 這是因為任何一個運算式只
    要含有 Null , 則該運算式就等于 Null, 實際上想要判斷某一數據是否為 Null
    絕對不能使用:
    If X = Null Then ' 永遠都會得到 Null
    而要使用:
    If IsNull(X) Then
    哪一種數據會等于 Null 呢? 除了含有 Null 運算式之外, 就屬沒有輸入任
    何數據的「數據字段」(在數據庫中) 會等于 Null。

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>