Modify

Opened 11 years ago

Closed 11 years ago

#2510 closed Bug (No Bug)

Empty variable

Reported by: Fulgor Owned by:
Milestone: Component: AutoIt
Version: 3.3.8.1 Severity: None
Keywords: Cc:

Description

local $aa    ; this variable is empty
local $bb="" ; this variable is empty
local $cc=1  ; this variable is not empty
local $dd=0  ; this variable is not empty, is the same like $cc

if $aa="" Then MsgBox(0, @ScriptLineNumber , "OK aa = is empty has len=0" & @CRLF & "len=" & StringLen($aa))
if $bb="" Then MsgBox(0, @ScriptLineNumber , "OK bb = is empty has len=0" & @CRLF & "len=" & StringLen($bb))
if $cc="" Then MsgBox(0, @ScriptLineNumber , "OK cc = is not empty has len=1" & @CRLF & "len=" & StringLen($cc))

if $dd="" Then
  MsgBox(0, @ScriptLineNumber , "ERROR dd = is not empty has len=1 " & @CRLF & "len=" & @CRLF & StringLen($dd))
Else
  MsgBox(0, @ScriptLineNumber , "OK dd = is empty has len=0" & @CRLF & "len=" & @CRLF & StringLen($dd))
EndIf

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

AutoIt is doing conversion when variable type are not the same so "" and 0 are the same after conversion
NO BUG

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.