array inside loop?

BlitzMax Forums/BlitzMax Beginners Area/array inside loop?

Amon_old(Posted 2004) [#1]
Hi!

In the mapeditor for my game I have placed the array inside a loop because I want it to refresh whenever changes are made. Two things I wanted to ask :

1) Is having an array inside a loop wrong?
2) Should I have the array outside the loop and use a for next loop to refrsh it? ie. when a new tile is placed?

thx for any help
:)


ImaginaryHuman(Posted 2004) [#2]
I'm not quite sure how to envision what your code looks like. You can access your array from more or less wherever you want to. Do you really need to go through the entire array in order to change just one tile? Surely you would just access and change the specific part of the array, e.g. TileArray[15,19]=TileNumber


Amon_old(Posted 2004) [#3]
Hi!

I kindof need to run through the array every loop to check for changes that I make when I place or erase tiles with the mouse. I think I'm going about it the right way so far but now have other problems.

:)