Modify

Opened 18 years ago

Closed 18 years ago

#458 closed Bug (No Bug)

($var == '')=true for, Array, DllStruct.(?)

Reported by: mvgulik Owned by:
Milestone: Component: AutoIt
Version: 3.2.12.0 Severity: None
Keywords: compare array dllStruct Cc:

Description

($var == ) = true for, Array, DllStruct.(?)

not sure if this is correct autoit behavior or not.(bug?)
but the following ($var == "") test returns true for a array type var.
kind a expected it to return a false as the var type/content is not a string, nor empty.
(same is true for a DllStruct var)

;~ dim $var = DllStructCreate("byte")
dim $var[2] = [1,2]
dim $Out = "if $var == '' then" & @CRLF
if $var == '' then
	$Out &= 'True'
else
	$Out &= 'False'
EndIf
ConsoleWrite($Out & @CRLF)
MsgBox(0,'MsgBox',$Out)

tested on v3.2.12.1(missing in version list) and v3.2.13.4
also tested on v3.0.100.0 witch returned false(array).

Attachments (0)

Change History (3)

comment:1 by mvgulik, 18 years ago

ignore the v3.2.12.1(missing in version list) part.

comment:2 by mvgulik, 18 years ago

return behavior switches from false to true between v3.0.102.0 and v3.1.0.15

comment:3 by Valik, 18 years ago

Resolution: No Bug
Status: newclosed

Given that you used the STRING COMPARE OPERATOR, what part about this is a bug?

Anyway, this isn't a bug no matter what operator you use. Internally, types are changed around during comparisons and types that don't have a string representation return an empty string.

Not a bug.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.