VBS内置函数大全

标签: , ,

虽然VBS提供了很多内置函数供我们使用,但是常用的也就那么几个,所以你一定不知道VBS内置函数一共有多少个。

VBS内置函数一共有107个,是不是有些没见过?

CCur CInt CLng CBool CByte CDate CDbl CSng CStr Hex Oct VarType IsDate IsEmpty IsNull IsNumeric IsArray IsObject Atn Cos Sin Tan Exp Log Sqr Randomize Rnd Timer LBound UBound RGB Len LenB Left LeftB Right RightB Mid MidB StrComp LCase UCase LTrim RTrim Trim Space string InStr InStrB AscB ChrB Asc Chr AscW ChrW Abs Fix Int Sgn Now Date Time Day Month Weekday Year Hour Minute Second DateValue TimeValue DateSerial TimeSerial InputBox MsgBox CreateObject GetObject DateAdd DateDiff DatePart TypeName Array Erase Filter Join Split Replace StrReverse InStrRev LoadPicture ScriptEngine ScriptEngineMajorVersion ScriptEngineMinorVersion ScriptEngineBuildVersion FormatNumber FormatCurrency FormatPercent FormatDateTime WeekdayName MonthName Round Escape Unescape Eval Execute ExecuteGlobal GetRef

纳尼,全部都见过?那你一定认真看过VBS参考文档。的确,文档中有所有的函数说明,但是一个一个复制粘贴的话会累死的。

VBS有多少个内置函数,我们还是问问VBS自己吧:


Set tli = CreateObject("TLI.TLIApplication")
Set TypeLibInfo = tli.TypeLibInfoFromFile("vbscript.dll")
'Author: Demon
'Date: 2012-9-19
'Website: http://demon.tw
For Each Interface In TypeLibInfo.Interfaces
    If Interface.Name = "GlobalObj" Then
        For Each Member In Interface.Members
            If Member.AttributeMask = 0 Then
                WScript.Echo Member.Name
            End If
        Next
    End If
Next

随机文章:

  1. PT流量作弊工具之mRatio
  2. 对VBS效率的再思考——处理二进制数据
  3. 再谈CreateObject函数,VBS到底能调用哪些对象?
  4. NDS模拟器NO$GBA
  5. Unable to find the socket transport "ssl" – did you forget to enable it when you configured PHP?

2 条评论 发表在“VBS内置函数大全”上

  1. […] Demon's Blog  »  程序设计  »  VBS内置常量大全 « VBS内置函数大全 […]

  2. […] 5.6.1,下载来测试了一下,VbsEdit 5.6.1仍然没有完全支持VBS所有的关键字、内置函数和常量。发了封邮件给VbsEdit的作者,却石沉大海,遂发布VbsEdit […]

留下回复