New variables not zero and zeroing them causes problems.
sccoupe
Posts: 118
I am having some issues with new variable arrays. It seems like maybe they are overlapping code space but as you can see there is plenty of ram left. If a new 'long VariableID[100]' is created in the VAR section and then read, each long seems to already have a random number in it. Should these not be zero when they are declared? To further the issue, if I manually zero these values at the beginning of the object, the whole program locks up. Any ideas here?
Comments
You have a problem in your code.
Yes, variables declared in the VAR section will have the initial value of zero. Some part of your code is overwriting these values.
We won't be able to help much without seeing the code.
This returns a value that is not zero.
I like using the first solution kuroneko suggested. IMO, the first notation looks cleaner than the second.
Remember the elements of your array are numbered 0 through 99. So the first element is ID2[0].