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 / How do I save data to a file?

Author
Message
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 12th Feb 2003 23:28
For a randomize function in a program I need to save a variable in a file and increment the variable each time the program runs. How do I do it? (in dbpro)
Those of you who think you know everything are annoying to those of us who do.
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 12th Feb 2003 23:38
To read a variable use:


To write a variable use:


Maybe after each read, you should delete the file, and rewrite the variable so you dont get dual entries.

Whatever I did I didn't do it!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 13th Feb 2003 10:36
It's alright it doesn't matter now. I just used


Those of you who think you know everything are annoying to those of us who do.
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 13th Feb 2003 11:32
But that wont save the data though witchbomber
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 13th Feb 2003 14:33
Lol! Ya, that program wont do anything! You havent defined what random is

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
actarus
22
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 13th Feb 2003 15:01
What kind of data do you want to write into the file?

Just remember that you're standing on a planet that's evolving
And revolving at nine hundred miles an hour!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 13th Feb 2003 15:09
I've tested it and it works.

Those of you who think you know everything are annoying to those of us who do.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 13th Feb 2003 16:03
Are you simply trying to get a random number on each run of program.

If you want random number between 1 and 1000 for example:



I love it when a plan comes together
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 13th Feb 2003 22:49
If you are writing a file, use Kents example.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Witch Bomber
21
Years of Service
User Offline
Joined: 25th Jan 2003
Location: Scotland
Posted: 14th Feb 2003 01:38
I found out about the timer command just after working out that way. It's really annoying when something like that happens.

Those of you who think you know everything are annoying to those of us who do.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 14th Feb 2003 03:09
OK, but thats still not writing data to a file

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-11-24 02:52:18
Your offset time is: 2024-11-24 02:52:18