Opened 14 years ago

Closed 14 years ago

#1234 closed Bug (Fixed)

Scripting.Dictionary call converting referenced AutoIt booleans to numbers

Reported by: Gabriel13 Owned by: Valik
Milestone: Component: AutoIt
Version: Severity: Blocking
Keywords: Cc:


I've run into a situation where a Scripting.Dictionary object method call is changing variable types within an AutoIt array, simply by referencing them.

func testDictionary($a)
	local $d=objCreate('Scripting.Dictionary')
	for $i=0 to ubound($a)-1
	return $d

local $aTest[2]=[false,true]

msgbox(0,default,$aTest[0]) ; displays false
msgbox(0,default,$aTest[1]) ; displays true

local $ignore=testDictionary($aTest)

msgbox(0,default,$aTest[0]) ; displays 0 instead of false
msgbox(0,default,$aTest[1]) ; displays 1 instead of true

Apparently, when the $d.add() call references $a[$i], it's also converting booleans to numbers within the array itself, and those changes are reflected in the original array afterwards.

In this example, the problem goes away if I change the top line to:

func testDictionary(const byRef $a)

I've verified that this bug is present in the beta as well.

Attachments (0)

Change History (3)

comment:1 Changed 14 years ago by Valik

  • Severity changed from None to Blocking

comment:2 Changed 14 years ago by Jpm

  • Owner set to Valik
  • Status changed from new to assigned

comment:3 Changed 14 years ago by Valik

  • Milestone set to
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed by revision [5303] in version:

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

as closed The owner will remain Valik.

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

Note: See TracTickets for help on using tickets.