Opened 16 years ago
Closed 16 years ago
#831 closed Feature Request (Rejected)
Arrays with ranged size - optimizing without breaking compatibility with old scripts
Reported by: | madflame991 | Owned by: | |
---|---|---|---|
Milestone: | Component: | AutoIt | |
Version: | Severity: | None | |
Keywords: | opitimization, arrays, ranged | Cc: |
Description
Many many times I wished AutoIt had arrays with ranged size... there are numerous situations when I really don't use element0 from an array simply because I, as a human being, like to count starting from 1. Another thing is that there are some algorithms which can be optimized like in the example below:
Dim $counter[65..90] For $i = 1 to StringLen($s) $counter[Asc(StringMid($s,$i,1))] += 1 Next
should be faster than
Dim $counter[26] For $i = 1 to StringLen($s) $counter[Asc(StringMid($s,$i,1))-65] += 1 Next
because of the missing -65
The best part is that backward compatibility won't be ruined because arrays declared as "Dim $array[10]" will by default mean "Dim $array[0..9]" for the "compiler".
This method of declaring arrays is found in user-friendly programming languages such as Pascal and Basic, whereas the old style is used in the middle level C programming language.
Also, from what I can tell it shouldn't be to hard to implement, but... you know what's best!
Thank you for your time,
madflame991
Attachments (0)
Change History (2)
comment:1 Changed 16 years ago by TicketCleanup
- Version 3.3.0.0 deleted
comment:2 Changed 16 years ago by Valik
- Resolution set to Rejected
- Status changed from new to closed
Err, no chance in hell that's going to happen. It took me a good 2 minutes just to figure out what the heck you had going on. Imagine how that looks to people who can't understand array's as-is?
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.
Automatic ticket cleanup.