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 / help with data restore, please

Author
Message
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 20th Oct 2006 18:44
is there a way to pass a variable into a RESTORE command?

that is, can I do something like this to restore test(1):

x=1

restore test(x)

test(1):
data 1,1,1,1

If this isn't possible, is there some way to do this that will enable me to use a loop for restoring data?

Many Thanks,

D
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Oct 2006 21:50
Neither is possible. It sounds like you want an array really. Use the READ command to read the data into the array, then access the array for your values.

Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 23rd Oct 2006 20:45
Thank you Ian!

An array worked, but a loop would have saved a few lins of code.

Happy Halloween!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 24th Oct 2006 01:52
Keeping your data in an external file rather than in the code also saves lines.
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 25th Oct 2006 15:15
Grog,

Yes, but this is just for initial, static variables. I will have the dynamic variables stored in a DB or text file when I get to that point.

Is a DB preferable over a text file?

Thank you for your help!!

D
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 26th Oct 2006 01:42
Ah you're doing ok then.

It's always better to have dynamic variables outside of your code... mostly for ease of editing.

Login to post a reply

Server time is: 2024-11-26 07:46:00
Your offset time is: 2024-11-26 07:46:00