Jcat
          寵辱不驚,閑看庭前花開花落~~
          posts - 173,comments - 67,trackbacks - 0
          Note If you need to determine whether an optional argument was passed to a function, you MUST declare the optional argument as a Variant data type. Then you can use the IsMissing function within the procedure.

          Option?Explicit

          Function?explicitType(Optional?s?As?Integer)
          ??? Debug.Assert?IsNull(s)?
          =?False
          ??? Debug.Assert?IsMissing(s)?
          =?False
          ??? Debug.Assert?s?
          =?0
          ??? explicitType?
          =?s
          End?Function


          Function?variantType(Optional?s)
          ??? Debug.Assert?IsNull(s)?
          =?False
          ??? Debug.Assert?IsMissing(s)?
          =?True
          ??? 'Debug.Print?s??'Error?448
          ??? variantType?=?s
          End?Function


          Sub?test()
          ??? Debug.Print?explicitType()
          ??? Debug.Print?variantType()
          End?Sub

          posted on 2008-03-28 16:23 Jcat 閱讀(274) 評論(0)  編輯  收藏 所屬分類: VBA

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 永济市| 尉犁县| 淳化县| 沐川县| 桂林市| 绍兴县| 牡丹江市| 张家川| 通城县| 黔东| 正蓝旗| 安乡县| 梨树县| 清远市| 江孜县| 温宿县| 霍州市| 塘沽区| 页游| 南和县| 焉耆| 洞头县| 吕梁市| 赞皇县| 中卫市| 清远市| 磴口县| 墨竹工卡县| 墨脱县| 呼伦贝尔市| 牡丹江市| 库尔勒市| 方城县| 莎车县| 芜湖市| 吴堡县| 太保市| 乐安县| 民权县| 尉氏县| 安岳县|