#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 by , 12 years ago
follow-up: 6 comment:2 by , 12 years ago
| Resolution: | → Rejected |
|---|---|
| Status: | new → 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:4 by , 12 years ago
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 by , 12 years ago
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
comment:6 by , 12 years ago
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 EndIfA 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.

Ciao.