Code: Select all
MsgBox, % StrLen( "" ) is integer
Code: Select all
MsgBox, % 0 is integer
Code: Select all
MsgBox, % StrLen( "" ) is integer
Code: Select all
MsgBox, % 0 is integer
Your MsgBox, % makes it an expression.Note: The operators "between", "is", "in", and "contains" are not supported in expressions.
Code: Select all
If 0 is integer
MsgBox 0 is integer
Else
MsgBox 0 is not integer
the if-construct MUST use a variable name. it cannot be a value. the only reason the above works is because the variable named "0" is undefined. see here:JoeWinograd wrote: ↑09 Nov 2019, 21:36Try this:
Code: Select all
If 0 is integer MsgBox 0 is integer Else MsgBox 0 is not integer
Code: Select all
0 := "hello"
If 0 is integer
MsgBox 0 is integer
Else
MsgBox 0 is not integer
Code: Select all
var:="0"
If var is integer
MsgBox var=%var% and is integer
Else
MsgBox var=%var% and is not integer
var:="x"
If var is integer
MsgBox var=%var% and is integer
Else
MsgBox var=%var% and is not integer
Code: Select all
IsInteger( var )
{
if var is integer
{
return true
}
else
{
return false
}
}
MsgBox, % IsInteger( 0 )
Code: Select all
IsInteger( var )
{
if( var is integer )
{
return true
}
else
{
return false
}
}
MsgBox, % IsInteger( 0 )
correct.
Users browsing this forum: adam86shadow, balawi28, JKJadan and 267 guests