Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String is corrupted
#11
Quote:I tried chaOs's way and i got the expected , or end of statement message

post or pm me your code
Reply
#12
WTF! LOOK AT THE TOPIC I POSTED DAMMIT! IT HAS THE SOLUTION!!!!!!! :evil:

Look this is what Nek wrote there:
Quote:The real problem here is that you're overwriting memory. First of all, you're BSAVEing 10000 bytes, and trying to load those 10000 bytes into a 202 byte array...that is assuming you're using Integer arrays (whicih you should be). You need to save the amount of data you're actually going to use, not just a big number.
Code:
arraySize = SpriteWidth * SpriteHeight / 2 + 1
Dim mySprite(arraySize) As Integer

To properly use BSAVE, you use a similar formula:
Code:
bsaveSize = SpriteWidth * SpriteHeight + 4
Def Seg = VarSeg(mySprite(0))
Bsave "mysprite.gfx", VarPtr(mySprite(0)), bsaveSize

That should work fine. To load it, you've almost got it right, but you're forgetting a minor detail:
Code:
Def Seg = VarSeg(mySprite(0))
Bload "mysprite.gfx", VarPtr(mySprite(0))
i]"But...it was so beautifully done"[/i]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)