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.

DarkBASIC Professional Discussion / Got some problems with file commands

Author
Message
Dragon slayer
19
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 2nd Feb 2013 04:23
his is some code I have been playing around with.



I have been having some problems understanding file commands. I am understanding a little better but I want to test it and can't quite figure out how. I have tried print commands but can't get anything to print out.

What I want to do is make a character, exit the program start the program with the exe see the character I made before and then make a new character and see that one the next time I start. I just can't seem to get it to work.

I want the player to be able to create a bunch of characters, a list of characters with attributes and stats and stuff. I want them to be able to call that list up and pick a character to add to a party. I am pretty sure I need to store that character list in a file.

Thanks
Dragonslayer
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 2nd Feb 2013 09:26
There are a few issues with your code. To begin with, the characters will never get saved, nothing instructs the program to run the instructions after the loop keyword. Use a function or subroutine to access these instructions.

Also, index is always zero; only one command in the program assigns a value to your variable; index = 0. Increase this by one each time a new character is created, and consider using array commands for variable character counts.

Login to post a reply

Server time is: 2026-07-07 00:31:46
Your offset time is: 2026-07-07 00:31:46