Weird problem restoring dataArchives Forums/BlitzPlus Programming/Weird problem restoring data
| Hey everybody|
In my code I have two labels, we can call them .Label1 and .Label2. After each label is a data statement. I first use restore label1, then read a bunch of data. Then I restore label2 and restore another bunch. The problem is I always get the data from the FIRST data statement. So I get the data from label1 both times. If I swap label1 and label2 I get the data from label2 both times. I just can't figure out what the heck this is?! Any ideas?
| Maybe its something you're doing wrong?|
| That code works for me as well, but if I do the same thing in my own code, I still get the same data both times. This is so weird! |
| Maybe you should post some/all of your code... |
| The code is huge. Here are the exact conditions:|
The two labels are at the bottom of the code, one is named creditsdata, the other helpdata. They are both built in this format: n,string,string,string... where n is the number of strings.
I restore the labels from within two separate functions, but I get the same result if I restore them in the same function.
I guess that's all there is to say about that.
| You aren't making any sense.|
You state you have two labels (named creditsdata and helpdata)
Then you state that they are both built in ...
What are you talking about? You don't 'build' a label
Labels' syntax is: .label (period, followed by alphanumeric identifier that must start with a letter)
It sounds like you are confusing labels with data statements.
| Yes, of course I am. I mean the data statements consists of a number and then strings. Sorry. |
| You really should post the relevant parts of your code. It's probably something obvious. |
| OK, sure.|
In my function:
| When you're using the Restore command, you don't put the "." with the label. You only do that when you're defining labels. Could that be the problem I wonder?|
(I'm guessing here - don't have Blitzplus installed any more)
| yep, that's the problem. Because it doesn't understand the label with the period in front of it, it just restores to the first set of data. |
| Oh really, I gotta try that right away. |
| Great, it worked!|
Thanks a lot, and merry christmas!
| The forum again proves is excellent help :-D |