Modify

Opened 3 years ago

Closed 3 years ago

#2789 closed Bug (Fixed)

With EndWith parameter issue

Reported by: jaberwacky Owned by: Jon
Milestone: 3.3.13.13 Component: AutoIt
Version: 3.3.13.1 Severity: None
Keywords: Cc:

Description

Sorry for the title.

The following code demonstrates an issue with using parameters using With/EndWith. If the second parameter is not acessed directly but instead accessed by With then the function fails. Wow, I really don't have an elegant way to describe this. Let's let the example, which I haven't run, (provided by FaridAgl) speak for itself.

Global $oDictionary = ObjCreate("Scripting.Dictionary") 

$oDictionary.Add("A", "Value of A") 

With $oDictionary     
  MsgBox(0, .Count, $oDictionary.Item("A")) ;Doesn't fails     
  MsgBox(0, .Count, .Item("A")) ;Fails     
  MsgBox(0, $oDictionary.Count, .Item("A")) ;Fails too
EndWith

Forum post: http://www.autoitscript.com/forum/topic/110379-autoitobject-udf/?p=1182987

Attachments (0)

Change History (4)

comment:1 follow-up: Changed 3 years ago by Synix <cross.fire@…>

I found out this doesn't fail:

With $oDictionary     
  MsgBox(0, .Count, $oDictionary.Item("A"))    
  MsgBox(0, .Count, (.Item("A")))   
  MsgBox(0, $oDictionary.Count, (.Item("A")))
EndWith

Seems like .Item("A") is getting treated as a function or something, if its not enclosed in brackets.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 3 years ago by Synix <cross.fire@…>

Forget my guess about the cause, it's something totally different.
It seems like, if a function call has two object parameters in a row it won't work in many cases. In some it does. Putting one of the parameters in brackets often fixes this, but you sometimes need to find out which one.
I couldn't find out more.

comment:3 in reply to: ↑ 2 Changed 3 years ago by Synix <cross.fire@…>

*two or more

comment:4 Changed 3 years ago by Jon

  • Milestone set to 3.3.13.13
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [10538] in version: 3.3.13.13

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 owner will remain Jon.
Author


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

 
Note: See TracTickets for help on using tickets.