VBS教程:函數-TypeName 函數

來源:互聯網
上載者:User

TypeName 函數

返回一個字串,提供有關變數的 Variant 子類型資訊。

TypeName(varname)

必選項的 varname 參數,可以是任何變數。

傳回值

TypeName 函數傳回值如下:

描述
Byte 位元組值
Integer 整型值
Long 長整型值
Single 單精確度浮點值
Double 雙精確度浮點值
Currency 貨幣值
Decimal 十進位值
Date 日期或時間值
String 字串值
Boolean Boolean 值;TrueFalse
Empty 未初始化
Null 無有效資料
<object type> 實際物件類型名
Object 一般對象
Unknown 未知物件類型
Nothing 還未引用對象執行個體的物件變數
Error 錯誤

說明

下面的樣本利用 TypeName 函數返回變數資訊:

Dim ArrayVar(4), MyTypeNullVar = Null    '  Null 值。MyType = TypeName("VBScript")   ' 返回 "String"MyType = TypeName(4)            ' 返回 "Integer"MyType = TypeName(37.50)        ' 返回 "Double"MyType = TypeName(NullVar)      ' 返回 "Null"MyType = TypeName(ArrayVar)     ' 返回 "Variant()"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.