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

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


          網站導航:
           
          主站蜘蛛池模板: 申扎县| 德江县| 浏阳市| 乐业县| 中宁县| 漠河县| 永川市| 平山县| 金湖县| 湘潭市| 札达县| 福贡县| 肃北| 巩留县| 中西区| 双峰县| 涟源市| 钦州市| 揭阳市| 玉山县| 西青区| 芷江| 舟曲县| 黄梅县| 冀州市| 当雄县| 林口县| 墨脱县| 滨海县| 广汉市| 天水市| 邹平县| 南岸区| 若羌县| 房产| 奉贤区| 宝清县| 隆安县| 桂阳县| 秭归县| 靖江市|