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 / Can't write to file!

Author
Message
tech forumz
16
Years of Service
User Offline
Joined: 9th Aug 2008
Location:
Posted: 10th Aug 2008 00:33
Ok, I'm working on a game, and I'm currently writing the database portion, but to test it on the game, I need to create a database. Since I have no idea how to do this manually, I wrote a small program to write a database for testing. However, whenever I run it, it just displays:

I think either my FOR loop is malformed or my write string is malformed. Can someone please explain what I'm doing wrong please! Thanks is greatly appreciated.


Ed222
17
Years of Service
User Offline
Joined: 3rd Nov 2007
Location: Calgary
Posted: 10th Aug 2008 02:26 Edited at: 10th Aug 2008 02:27
I don't know what you really mean but heres what I'd do. i'd use this to genrate the database one for category one for clothes etc that can be done using this

Then after creating the database you would use arrays as a id such as item(5) I hope I didn't lose you there tell me if you don't get it.

tech forumz
16
Years of Service
User Offline
Joined: 9th Aug 2008
Location:
Posted: 10th Aug 2008 02:48
Thanks! I didn't know that the file couldn't exist when you "'open' to write" Thank you very much! BTW your program worked, but I'd rather use my own to learn more about how to implement. Thank you very much!
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 10th Aug 2008 03:14 Edited at: 10th Aug 2008 03:14
Quote: "I think either my FOR loop is malformed or my write string is malformed."

It's your FOR loop. For loops work like this:



or, with your ID example,



Your WRITE STRING code looks fine to me Hopefully this should fix your problem.

Oh, and make sure that when you open a file for writing it doesn't already exist. You can check if it exists by using the FILE EXIST(filename) command and delete it using the DELETE FILE filename command.

Login to post a reply

Server time is: 2024-11-24 23:12:56
Your offset time is: 2024-11-24 23:12:56