Tải bản đầy đủ (.pdf) (9 trang)

AutoIT Help part 110 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (24.38 KB, 9 trang )

Return Value
Success:

Returns 1.
Failure:

Returns 0 if expression is not integer.

Remarks
IsInt(7.5 - 2.5) returns 1 (meaning true).
Related
IsArray, IsFloat, IsString, IsNumber, IsBool, IsHWnd, StringIsInt
Example

IsInt(-12345) ;returns 1
IsInt(3.0000) ;returns 1
IsInt("5432") ;returns 0 since is a string
IsInt(7.5 - 4.5) ;returns 1 since evaluates to integer 3




Function Reference
IsKeyword
Checks if a variable is a keyword (for example, Default).
IsKeyword ( variable )
Parameters
variable The variable to check.

Return Value
Success:



Returns 1 if variable is a keyword.
Failure:

Returns 0 if variable is not a keyword.

Remarks
Related
Default
Example

$a = default
If IsKeyword($a) Then MsgBox(0,"Ok", "Yes it is")




Function Reference
IsNumber
Checks if a variable's base type is numeric.
IsNumber ( variable )
Parameters
variable The variable/expression to check.

Return Value
Success:

Returns 1.
Failure:


Returns 0 if expression is not numeric type.

Remarks
Variants can be of two base types: Strings and Numbers. Additionally, a number
can be whole (integer) or fractional/floating-point.
Related
IsArray, IsFloat, IsInt, IsString, IsBool, IsHWnd
Example

IsNumber(42)




Function Reference
IsObj
Checks if a variable or expression is an object type.
IsObj ( variable )
Parameters
variable The variable/expression to check.

Return Value
Success:

Returns 1 if expression is an object variable.
Failure:

Returns 0 if expression is not an object variable.

Remarks

Related
ObjGet, ObjCreate
Example

$oShell = ObjCreate("shell.application")
if not IsObj($oShell) then
Msgbox(0,"Error","$oShell is not an Object.")
else
Msgbox(0,"Error","Successfully created Object $oShell.")
endif




Function Reference
IsPtr
Checks if a variable's base type is a pointer.
IsPtr ( variable )
Parameters
variable The variable/expression to check.

Return Value
Success:

Returns 1 if the expression is a pointer type.
Failure:

Returns 0 if expression is not pointer type.

Remarks

Related
IsArray, IsFloat, IsHWnd, IsInt, IsString, IsNumber, IsBool, Ptr
Example

Run("notepad.exe")
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
If IsPtr($hWnd) Then
MsgBox(4096, "", "It's a valid Ptr")
Else
MsgBox(4096, "", "It's not a valid Ptr")
EndIf




Function Reference
IsString
Checks if a variable is a string type.
IsString ( variable )
Parameters
variable The variable/expression to check.

Return Value
Success:

Returns 1.
Failure:

Returns 0 if expression is not string type.


Remarks
None.
Related
IsArray, IsFloat, IsInt, IsNumber, IsBool, IsHWnd, IsBinary
Example

$x = IsString("foo")




Function Reference
AutoItSetOption
Changes the operation of various AutoIt functions/parameters.
AutoItSetOption ( "option" [, param] )
Parameters
option The option to change. See Remarks.
param
[optional] The value to assign to the option. The type and meaning
vary by option. See remarks below. If the param is not provided, then
the function just returns the value already assigned to the option. The
keyword Default can be used for the parameter to reset the option to
its default value.

Return Value
Returns the value of the previous setting for the option.
Remarks
You may use Opt() as an alternative to AutoItSetOption().

AutoIt will halt with an error message if the requested option is unknown. Options

are as follows:

Option

Param

CaretCoordMode
Sets the way coords are used in the caret functions, either
absolute coords or coords relative to the current active
window:
0 = relative coords to the active window
1 = absolute screen coordinates (default)
2 = relative coords to the client area of the active window
ExpandEnvStrings
Changes how literal strings and % symbols are
interpreted. By default strings are treated literally, this
option allows you to use %environment% variables inside
strings, e.g., "The temp directory is: %temp%".
1 = expand environment variables (similar to AutoIt v2)
0 = do not expand environment variables (default)
Without this option the usual way would be: "The temp
directory is: " & EnvGet("temp")
ExpandVarStrings
Changes how literal strings and variable/macro ($ and @)
symbols are interpreted. By default strings are treated
literally, this option allows you to use variables and
macros inside strings, e.g., "The value of var1 is $var1$".
1 = expand variables (when in this mode and you want to
use a literal $ or @ then double it up: "This is a single
dollar $$ sign".

0 = do not expand variables (default)
FtpBinaryMode
Changes how FTP files are transferred.
1 = Binary (default)
0 = ASCII
GUICloseOnESC
When ESC is pressed on a GUI the
$GUI_EVENT_CLOSE message is sent. This option
toggles this behavior on and off.
1 = Send the $GUI_EVENT_CLOSE message when ESC
is pressed (default).
0 = Don't send the $GUI_EVENT_CLOSE message when
ESC is pressed.
GUICoordMode
Alters the position of a control defined by GUICtrlSetPos.

1 = absolute coordinates (default) still relative to the
dialog box.
0 = relative position to the start of the last control (upper
left corner).
2 = cell positionining relative to current cell. A -1 for left
or top parameter don't increment the start.
So next line is -1,offset; next cell is offset,-1; current cell
is -1,-1.

Obviously "offset" cannot be -
1 which reserved to indicate
the no increment. But if you can use a multiple of the
width you choose to skip or go back.
GUIDataSeparatorChar


Define the character which delimits subitems in
GUICtrlSetData.
The default character is '|'.
GUIOnEventMode
Enable/disable OnEvent functions notifications.
0 = (default) disable.
1 = enable.
GUIResizeMode
Change default resizing for a control.
0 = (default) keep default control resizing.
<1024 = anytype of resizing see GUICtrlSetResizing.
GUIEventOptions
Change special event behavior or GUI function return
values.
0 = (default) Windows behavior on click on
Minimize,Restore, Maximize, Resize.
1 = suppress windows behavior on minimize, restore or
maximize click button or window resize. Just sends the
notification.
MouseClickDelay
Alters the length of the brief pause in between mouse
clicks.
Time in milliseconds to pause (default=10).

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×