Opened 15 years ago

Closed 15 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:


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

should be faster than

Dim $counter[26]
For $i = 1 to StringLen($s)
  $counter[Asc(StringMid($s,$i,1))-65] += 1

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,

Attachments (0)

Change History (2)

comment:1 Changed 15 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

comment:2 Changed 15 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.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

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

Note: See TracTickets for help on using tickets.