Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Restore command problem?

Author
Message
Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 17th Jun 2009 20:25
For some reason I'm having problems with the restore command.


If you check the file attached, you can see the problem in the editing "play" section.

Apparently I can only restore to play one time to read data before it stops working and refuses to read. Help please

Attachments

Login to view attachments
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Jun 2009 20:33
And how does the data section look?

Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 17th Jun 2009 20:59


thats the data for the play section at the moment.

Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Jun 2009 19:36
Hmm, is no one understanding my problem either?

Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 20th Jun 2009 19:57
I guess your problem might be using the label 'play', since it is part of several keywords. Why not try changing it to MyDataLabel: or something else and retrying?

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Jun 2009 20:03
Didn't work but i noticed something new. It works occasionlly. It will work once, error a few times, work again, error some more, etc.

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 20th Jun 2009 20:04 Edited at: 20th Jun 2009 20:12
doesn't the RESTORE command just restore one line? can't you just do restore, so it restores the data pointer to the first data string?

[edit]
this just works fine, it only prints 1s and 2s and no 3s and 4s



Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Jun 2009 20:12
Hmm, that also did nada. Further study reveals that it will only work on the first code inputted but only on 2 error intervals.

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Jun 2009 20:38
It looks like it's restoring fine to me. But you're reading the data way too much.



Here you have a FOR/NEXT loop to read the data starting at the label Play from 1 to the size of the array (I assume 14) and you read comint from the data. The first data statement after Play is "data 14" which makes the variable comint=14. Next you do this:



Which is another FOR/NEXT loop from 1 to 14. So you have two loops around each other both counting from 1 to 14... so you're reading the 14 lines of data 14 times. Each time it RESTOREs to Play perfectly.

Add this under "read codenum$, statement$, statement2$" to see what I mean.


Do you really need 14 copies of the same data? It actually stopped working on me too after restoring to play about 70 times (running it several times). Since it seems unstable why not use a file instead of DATA? You don't even have to use codenum$. You can use the array index number as the code number.

Databug
16
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Jun 2009 20:53
Ah ok, I see what you're saying. I will get right on that after I finish cleaning the house. Thanks a lot there!

Login to post a reply

Server time is: 2024-11-25 04:50:38
Your offset time is: 2024-11-25 04:50:38