Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2604 closed Feature Request (Rejected)

Array access on expression & first element

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

Description

Sorry for my English

can be enabled (in Array access on expression) to read\access the first item\element directly (without specify it), example

Local $aTest1[4] = [1,2,3,4], $aTest1[4] = ["One","Two","Three","Four"], $aTest3[4][4] = [[0,1,2,3],[4,5,6,7]]
If ($aTest1) = 1 Then
	;ect ect ect
EndIf

If ($aTest2) = "One" Then
	;ect ect ect
EndIf

If ($aTest3) = 0 Then
	;ect ect ect
EndIf

Ciao.

Attachments (0)

Change History (6)

comment:1 Changed 10 years ago by DXRW4E

Local $aTest1[4] = [1,2,3,4], $aTest2[4] = ["One","Two","Three","Four"], $aTest3[4][4] = [[0,1,2,3],[4,5,6,7]]
If ($aTest1) = 1 Then
	;ect ect ect
EndIf

If ($aTest2) = "One" Then
	;ect ect ect
EndIf

If ($aTest3) = 0 Then
	;ect ect ect
EndIf

Ciao.

comment:2 follow-up: Changed 10 years ago by Mat

  • Resolution set to Rejected
  • Status changed from new to closed

Not a good idea. It would have to be a special case, that only applies when the array is used with a comparison operator as there would be other cases where it wouldn't work.

We'd probably start seeing code like:

If $a = 0 Then
    $a = 4
EndIf

A confusing feature, especially in a large code base, even with systems hungarian. For pretty much no saving either. Sure for arrays that have the count in the first index it might be nice.

I've rejected the request. PM me on the forums if you want to discuss it further, if another MVP or dev would like this feature then they can re-open the ticket.

comment:3 Changed 10 years ago by TicketCleanup

  • Version 3.3.10.2 deleted

Automatic ticket cleanup.

comment:4 Changed 10 years ago by anonymous

I think you have not understood very well the (Feature) Request http://www.autoitscript.com/forum/topic/157522-array-access-on-expression-first-element/?p=1141292

Ciao.

comment:5 Changed 10 years ago by DXRW4E

comment:6 in reply to: ↑ 2 Changed 10 years ago by DXRW4E

Replying to Mat:

Not a good idea. It would have to be a special case, that only applies when the array is used with a comparison operator as there would be other cases where it wouldn't work.

We'd probably start seeing code like:

If $a = 0 Then
    $a = 4
EndIf

A confusing feature, especially in a large code base, even with systems hungarian. For pretty much no saving either. Sure for arrays that have the count in the first index it might be nice.

I've rejected the request. PM me on the forums if you want to discuss it further, if another MVP or dev would like this feature then they can re-open the ticket.

the feature already exists

    AutoIt v3.3.10.0 (23rd December, 2013) (Release)
    Added: Array access on expression: StringSplit("a,b", ",")[1]

however i asked only an improvement

Ciao.

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.