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

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


          網站導航:
           
          主站蜘蛛池模板: 志丹县| 平湖市| 金门县| 邯郸县| 临桂县| 镇安县| 汽车| 科尔| 北京市| 玉门市| 邵东县| 抚顺市| 平昌县| 宁海县| 阿坝| 梁平县| 宜丰县| 广平县| 罗甸县| 德安县| 汕头市| 五原县| 竹溪县| 西乡县| 江山市| 博兴县| 陕西省| 阿尔山市| 固始县| 商洛市| 石柱| 靖边县| 个旧市| 绥江县| 韶山市| 庐江县| 松溪县| 上虞市| 扎赉特旗| 久治县| 罗山县|