Array question

Blitz3D Forums/Blitz3D Beginners Area/Array question

How often are you going to cycle through these arrays...looping through 1000 types isn't going to be that slow. But anyhow why don't you keep count of your type list- have global variables to represent which is the start of a sector population count and the second can represent the population of that type of object in that sector number...so if you wanted to make 100 zones then make your first generic type only one hundred big - you would need 200 global variable though...so perhaps use an array to hold those values is a way better idea. Basically if you then add 1 new station into a sector (let's say sector 10) you find it's sector number in your array - the first number is your start position in your type - the second number will hold the population count of that sector which to start will be 0 ( this is also the end count)...you then make your type by copying one of your global meshes and add 1 to the second number - then all sector numbers after sector 10 must be moved up 1, so add 1 to their value in your sector numbers array - as well as well (as adding one to the population end number) anything between start and end values is the poulation count ...this way you can keep track of all your sectors and their populations.
You use the array population start and end counts as the start and end numbers for your timer inside your type - you can use before and after as well as insert commands as well.
I just thought this out quickly so there may be some flaws here - but best bet is to just make a start on your system as it becomes more and more obvious what you must do to achieve your exact goal.

I hope you get it anyhow!