检查某个变量是否数组类型.
IsArray ( 变量 )
变量 | 要检查的变量/表达式. |
成功: | 返回值为1. |
失败: | 返回值为0,说明给定变量/表达式并非数组. |
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