Weird problem restoring data
BlitzPlus 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? Happy holidays! -- Martin Gunnarsson |
| ||
Maybe its something you're doing wrong? This works: Restore label2 Read A$ DebugLog A$ Restore label1 Read B$ DebugLog B$ WaitKey End .label1 Data "Label1" .label2 Data "Label2" |
| ||
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: Restore .CreditData Read credlines Restore .HelpData Read helplines Labels: .CreditData Data 3,"Credittest","","Credittest" .HelpData Data 2,"Helptest","Helptest" |
| ||
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 |