函数参考


IsArray

检查某个变量是否数组类型.

IsArray ( 变量 )

参数

变量 要检查的变量/表达式.

返回值

成功: 返回值为1.
失败: 返回值为0,说明给定变量/表达式并非数组.

注意/说明

可有效验证传递到用户定义函数的参数是否为数组.

相关

IsFloat, IsInt, IsString, IsNumber, IsBool, IsHWnd, IsBinary, IsPtr, VarGetType

示例/演示


Example()

Func Example()
    ; Run Notepad
    Run("notepad.exe")

    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

    ; Retrieve the position and size of the Notepad window by passing the handle to WinGetPos.
    Local $aPos = WinGetPos($hWnd)

    ; Check if the variable is an array.
    If IsArray($aPos) Then
        MsgBox(4096, "", "Window height: " & $aPos[3])
    Else
        MsgBox(4096, "", "An error occurred.")
    EndIf

    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example