函数参考


VarGetType

返回一个变量的AutoIt内部表示类型.

VarGetType ( 表达式 )

参数

表达式 要检查内部类型的表达式.

返回值

返回一个以字符串形式的,表示表达式类型的AutoIt内部类型.

注意/说明

当它尝试转换一个浮点数或者字符串为整数类型时,IsInt 可能返回一个不同的结果.

相关

IsInt, IsFloat, IsString, IsBinary, IsArray, IsDllStruct, IsHwnd, IsObj, IsBool, IsKeyword

示例/演示


Local $aArray[2] = [1, "Example"]
Local $bBinary = Binary("0x00204060")
Local $fBoolean = False
Local $hWnd = WinGetHandle("[CLASS:Shell_TrayWnd]")
Local $iInt = 1
Local $nFloat = 2.0
Local $sString = "Some text"
Local $vKeyword = Default

MsgBox(0, "Variable Types", "$aArray is an " & VarGetType($aArray) & " variable type." & @CRLF & _
        "$bBinary is a " & VarGetType($bBinary) & " variable type." & @CRLF & _
        "$fBoolean is a " & VarGetType($fBoolean) & " variable type." & @CRLF & _
        "$hWnd is a " & VarGetType($hWnd) & " variable type." & @CRLF & _
        "$iInt is an " & VarGetType($iInt) & " variable type." & @CRLF & _
        "$nFloat is a " & VarGetType($nFloat) & " variable type." & @CRLF & _
        "$sString is a " & VarGetType($sString) & " variable type." & @CRLF & _
        "$vKeyword is a " & VarGetType($vKeyword) & " variable type." & @CRLF)