共用方式為


gettype() (取類型的函數)

適用於:✅Microsoft網狀架構

傳回其單一自變數的運行時間類型。

運行時間類型可能與名義型別為 的表達式名義型別(靜態)類型 dynamic不同;在這種情況下 gettype() ,可以有助於顯示實際值的類型(值在記憶體中編碼的方式)。

語法

gettype( 價值)

深入瞭解 語法慣例

參數

姓名 類型​​ 必要 說明
價值 純量 ✔️ 要尋找型別的值。

傳回

字串,表示值的運行時間類型。

範例

下列範例顯示各種表達式的運行時間類型。

運算式 傳回
gettype("a") string
gettype(111) long
gettype(1==1) bool
gettype(now()) datetime
gettype(1s) timespan
gettype(parse_json('1')) int
gettype(parse_json(' "abc" ')) string
gettype(parse_json(' {"abc":1} ')) dictionary
gettype(parse_json(' [1, 2, 3] ')) array
gettype(123.45) real
gettype(guid(12e8b78d-55b4-46ae-b068-26d7a0080254)) guid
gettype(parse_json('')) null