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 / Dark Basic Classic reading .txt files.

Author
Message
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 6th Aug 2006 03:57
I'm trying to make a settings file in .txt format so that when I release the game, people will be able to modify and add things to the game without having to edit source code, but rather by editing a .txt file.
How do I make DBC read a .txt file and turn the contents into a string that I can later read and use?
flock
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 6th Aug 2006 06:55
Um, have you read the manual? It has a great deal on file manipulation in the - I think - Input section. (no offence)


Make the file, open to write, write string, close file. Then later you can either open to read that string (and store it in a var for your program to manipulate) or write over it. Searching the threads for file will bring up quite a few threads on the subject

a.k.a. "flockhound"
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 6th Aug 2006 07:11
Thanks ._.' I looked a little bit but couldn't find exactly what I was looking for... I'll try and find my manual.... XD
flock
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 6th Aug 2006 18:18
What were you looking for?

a.k.a. "flockhound"
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 6th Aug 2006 20:14
I was looking for .txt conversion... but I found stuff on turning .txt into actual code by changing .txt to .dbc or something. >.< I couldn't find a way to make the .txt temporary code, while keeping the file a .txt document.
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 7th Aug 2006 00:53
I don't know how, but this eludes me.

How do I make it so that DarkBasic will look for a SET of conditions, rather then just one. I want this to work, but it won't.


But that just tells me that if expects integers. >.<
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 7th Aug 2006 03:35 Edited at: 7th Aug 2006 03:37
First, Use "and" not a ","

Example:


Second, this statement will never come true! How can a number be greater less than 500 and greater than 600 at the same time? Ponder this. You will find that it isn't possible...

boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 7th Aug 2006 03:44
Yeah, I sorta tripped up on that, because I was caught up in the multiple "if"s not working like I thought I would. XD

Anywho, I figured out my trip after a bit, but thanks anyways.

One last thing, and then I SWEAR I won't get stuck for a while.
This question isn't as obvious, because I cleared it through a friend who is better then me at programming, but I know it's not hard.

I have code that has text, and when I click on some one word, a list of related words will appear. However, when I click on one of the other words, the second list comes in the same spot.
That's all supposed to happen, but how do I make the first list dissapear as I click to "open" the second list? >.<
flock
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 7th Aug 2006 07:59 Edited at: 7th Aug 2006 07:59
Well...

I've found a couple of things work. If the do loop where the lists are called from is synchronized, then you could put a box covering the entire behind of the lists' length and width. When you call one (you know, if blah = 1 then text 200,200,"something") then another (if blah = 2 then text 200,200,"different") then the first blah's text will erase itself. I've found, for some reason, text will not update itself without being "buffered" with some basic 2D.

Or you could call cls with each input you accept but you must then re-print the menu text then print the new text of the list.

Somebody have a better solution? I know mine work, but they've always seemed a little to barbaric to actually utilize...

By the way, what does ">.<" symbolize?

a.k.a. "flockhound"
boymonkey 130
18
Years of Service
User Offline
Joined: 16th Oct 2005
Location:
Posted: 7th Aug 2006 23:21
Yeah, those'll do for now, because I'm going to use pictures by the time it's finished, so Ir doesn't matter that it's not perfect since it's temporary text.

>.< Is like a sour face, like something's easy but being messed up, or making a stupid mistake.
flock
18
Years of Service
User Offline
Joined: 10th Mar 2006
Location: Earth
Posted: 8th Aug 2006 03:13
K. Good luck! (oooo, sour face)

a.k.a. "flockhound"

Login to post a reply

Server time is: 2024-09-25 05:25:49
Your offset time is: 2024-09-25 05:25:49