Posts: 1,556
Threads: 298
Joined: Dec 2002
I compiled my sprite editor. And at first it was giving me String Space Corrupt errors whenever I tried to load a file (not good). So I added Dynamic before it all, and now, when I try to load a file, the sprite editor just closes out. WTF!
Posts: 1,556
Threads: 298
Joined: Dec 2002
Uh, I don't really know how to write memory to any other places...
Posts: 1,556
Threads: 298
Joined: Dec 2002
Nope. If there was a typo like that, it wouldn't run in the IDE well either.
This problem only occurs when it's COMPILED though.
Posts: 1,556
Threads: 298
Joined: Dec 2002
ALRIGHT, the problem is that when I add the '$DYNAMIC bit, I get a subscript out of range error in the IDE, so when it's compiled, it just shuts off.
When '$DYNAMIC is gone however, it works fine, but won't compile.
Any ideas?
Posts: 6,419
Threads: 74
Joined: Mar 2002
We need scope. Post the exact SUB where this happens, post also the declaration of the array.
Posts: 1,688
Threads: 119
Joined: Jun 2003
kinda reminds me of my prog i'm working on. works fine in ide, but when i compile it won't work. during the compiling process, it says there's over 900 bugs :o
Jumping Jahoolipers!
Posts: 1,556
Threads: 298
Joined: Dec 2002
Here's where it happens.
Code:
SUB PutSprite (X, Y, Image(), Index)
FOR A = 0 TO Image(1, Index) 'ERROR OCCURS HERE
FOR B = 0 TO Image(0, Index) - 1
IF GetPixelImage(B, A, Image(), Index) <> 13 THEN
PutPixel X + B, Y + A, GetPixelImage(B, A, Image(), Index)
END IF
NEXT
NEXT
END SUB
And here are the only two arrays that are interacted with by that sub.
Code:
DIM SHARED EditSprite(2000, 5)
DIM SHARED Sprite(2000, 5)
It might help to have sample input data, and also to know what the 'index' sub itself does, too...