Well this isn't "universal" But if you have such a calculation going on that determines values inside the array and is always constant, you can avoid all the checking and just calculate what's the Index Number of a raw value.
As you determine index number's value to be Index number * 5, you can just:
Raw Value = Alpha
Index Number = Alpha / 5
This work in your example and erases alot of CPU usage (even more if the array is huge). Sometimes you could try to overcome the issue by doing things backwards. Let's say there's a situation where you need 100 bullets. You make an array for them like
dim bullet(100) as integer
Next step is to determine the object id for every bullet.
dim bullet(100) as integer
bulletID = 0
for n = 2000 to 2100 `here you have bullets ID=2000 to 2100
make object sphere n,1
bullet(bulletID) = n `here you determine the object ID for the array
inc bulletID
next n
Now this works, but if you have to search the object id inside the array You'll have to do exactly what you did on your example, or how IanM told. That's ok if you have 100 array items. What if you have 10000 or even more. You could have an array holding 100000 items, then looping that thru in 1 frame would make noticeable FPS jamming for a while. I would forget the array "raw value" that holds the ID, and using the actual Index number to be the value you're looking for. Like this(similar to the first solution I gave):
dim bullet(100) as integer
for n = 2000 to 2100
make object sphere n,1
next n
catch = GetObjectID(rnd(100))
function GetObjectID(index)
returned = index + 2000
endfunction returned
Like this, also made possible because the objects are sorted. Ofc this isn't possible anymore if the values are not in order. Well.. That's why I'm trying to use an order and sort out everything that's possible. a computer is a calculator, so do things by calculating them ;D I also find that sorted info is the best way to approach basicly everything
hmmmh.. that didn't compile