Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
String is corrupted
#1
I used BLOAD to load a file called grass.jpm (which i had just made, jpm being my initials) and i got an error when i tried to put it down, the screen then froze and in the corner i got "String is Corrupted" (or something like that), why did this happen?
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#2
...how did you make the file?
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#3
1. Make sure your BLoad size is the same as your BSave size and that your Bsave size is correct.

2. Make sure you are using the same arrays you DIMed when BLoading it.

3. Make sure your BLoading the right file. And the File is in the right place.

That should be it.
i]"But...it was so beautifully done"[/i]
Reply
#4
i did

DEFSEG = VARSEG(grass(0))
BSAVE "grass.jpm", 0, 1000

And to load it i did

DEF SEG = VARSEG(arrayname(0))
BLOAD "grass.jpm", 0
DEF SEG

It crashes when i use DEF SEG by itself (i didn't do that the first time and all i got was an error when i tried to put it)
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#5
A Rattra had the same problem....look at this:
Veiw Topic

Hope that helps.
i]"But...it was so beautifully done"[/i]
Reply
#6
that error is 100% of the time caused by everything with bload and memory manipulation in general.


remember, an integer in QB takes up 2 bytes, so you'll need to use the number of indices in the array Times 2

i.e.

dim grass%(499) ' 500 indices 0-499

the only other thing i can see that COULD cause problems is that youre not using the VARPTR... i dunno if this matters but just to be safe you should always do

Code:
DEFSEG = VARSEG(grass%(0))
BSAVE "grass.jpm", VARPTR(grass%(0)), 1000

instead of

Code:
DEFSEG = VARSEG(grass%(0))
BSAVE "grass.jpm", 0, 1000



but the next problem i see is that it is indeed grass() and not grass%().

QB defaults to Single data types, so every index in that array is taking up four bytes....

hope some of this helps you solve you problem dude
Reply
#7
Why did the computer crash though?
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#8
True.

If you do this:
DIM grass(size%) AS INTEGER

Then you don't need to do:
grass%()

You can just do:
grass() and it will still be an integer array.

I think its the last argument...the 1000.
Look at that topic Link I provided.
i]"But...it was so beautifully done"[/i]
Reply
#9
I tried chaOs's way and i got the expected , or end of statement message
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#10
Quote:Why did the computer crash though?


ok think about it

EVERYTHING is memory right?

your array if its "thing%(99)" takes up 200 bytes of memory

now every variable is at a certain "location" in memory, this is called its "address"

now lets say you write 200 bytes into that array. an array is set up "linear" which means it is essentially a chunk of memory 200 bytes long. you load 200 bytes into it, first you give it the "address" (segment (which is now obsolete) and offset (usually 0)). then the program will attempt to write those 200 bytes in a straight line, because you told it there was an array 200 bytes long to recieve it.

which brings us to why your program (and perhaps computer) crashed. its becuz you read too much into that adress.. think about it this way. you got a bucket that can hold 5 gallons. now lets say you have to pour EXTREMELY dangerous, volatile acid into the bucket. now, if you pour the right amount in, everythings fine, the bucket was designed to hold it. but if you try to pour in like 2000 gallons... yeah... <.<
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)