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 閱讀(270) 評論(0)  編輯  收藏 所屬分類: VBA

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


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 镇坪县| 云安县| 洛隆县| 微山县| 台江县| 塔城市| 台中县| 南木林县| 皮山县| 乌鲁木齐县| 凤城市| 拜城县| 宜丰县| 包头市| 佛冈县| 沽源县| 辉县市| 尼木县| 和龙市| 铅山县| 富源县| 盘山县| 松阳县| 郁南县| 桂东县| 江华| 怀来县| 诸暨市| 海南省| 灵川县| 永清县| 瑞安市| 荣成市| 庄河市| 肃宁县| 酒泉市| 定结县| 渑池县| 普陀区| 玛纳斯县| 和政县|