Modify ↓
Opened 12 years ago
Closed 12 years ago
#2505 closed Feature Request (Duplicate)
Array create without declaration
| Reported by: | anonymous | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
Local $aData = ['p','e','t'] ;OR _my(['p','e','t']) Func _my($aD) ;... EndFunc ;OR Local $aData[1][3] ;create array $aData[0] = ['p','e','t'] ;fill the first element ;must be the same as ;Local $aData[1][3] ;$aData[0][0] = 'p' ;$aData[0][1] = 'e' ;$aData[0][2] = 't'
Attachments (0)
Change History (6)
comment:2 by , 12 years ago
comment:3 by , 12 years ago
This is the correct format.
#include <Array.au3> Local $aArray[] = [0, 1, 2, 3] _ArrayDisplay($aArray)
comment:4 by , 12 years ago
The requesters first example works as well.
Local $aData = ['p','e','t']
Creates an array with 3 elements containing p, e, and t.
comment:6 by , 12 years ago
What you are asking for are called literal arrays.
The idea has been looked at before. I'm not sure how far it got, or whether it is still on the table.
comment:7 by , 12 years ago
| Resolution: | → Duplicate |
|---|---|
| Status: | new → closed |
Duplicate of #2548. I'm going to bend the rules slightly and close this ticket as a duplicate of the other one (don't shoot me guys) as the other ticket is better.
Note:
See TracTickets
for help on using tickets.

You can already use the first format to declare an array in the latest beta.