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 Discussion / [LOCKED] Open to Read, not reading right?

Author
Message
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 14th Nov 2007 03:08
When I try to load a breed into my game it has a certain string in a file, e.g.

Name
Breed
Images
Type
Personality

the breed's images that I want (Yorkshire Terrier) are in this folder, breeds\YTFiles\. Well the images string (imgs$) holds that information (the directory the file is in). But instead it saying "Lucky" for that string, when that is the filename and in the name string. Here is my code,



What is wrong? Here is the file layout (DBPro),


What is wrong?

Thanks,
Jordan

STOP reading my signature!
Dr Schnitzengruber
18
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 14th Nov 2007 03:41
I'm almost completely sure that you did not format your dogs information file correctly. I can't really tell because either that is only a very small snippet or your problem is obvious. Can I see the "dog$" file.(I could also bet that on that "dog$" file the first line is "Lucky")

the answer to life the universe and everything = 42
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 14th Nov 2007 04:00
Yea the first line of the file is Lucky, that was written in the name$ string. What are you saying?

STOP reading my signature!
Dr Schnitzengruber
18
Years of Service
User Offline
Joined: 19th Jul 2007
Location: C:/Projects/failed/ schnitzengruber
Posted: 14th Nov 2007 05:50


in that code you are asking to read the first string. You should put some "dummy" read string's between open to read and read string. For example if you wanted to read the third line of the file:


just replace b with the line of the file you want to read.

the answer to life the universe and everything = 42
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 14th Nov 2007 13:48
Now it says, file does not exist(on the image files). Grrr....

STOP reading my signature!
SimSmall
21
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 14th Nov 2007 16:33 Edited at: 14th Nov 2007 16:34
Well, you put in your first post that the code was in DBP -- It's been so long since I've used classic, but DBP often tries to find my files/folders relative to the TEMP directory and not the current project directory...

Before any reading/writing commands, you may wish to add a: set dir get dir$() line, which will switch the current dir to the project's dir. That may solve it not finding your images.
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 14th Nov 2007 21:58
Know this file was made in DBP,

so it could use BlueGUI but, the other stuff is pure Classic.

STOP reading my signature!
Sinani201
19
Years of Service
User Offline
Joined: 16th Apr 2007
Location: Aperture Science Enrichment Center
Posted: 15th Nov 2007 05:11
don't forget to close the file with the CLOSE FILE command! If you don't, you could write unwanted memory later on...

how do you make a sig?
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 15th Nov 2007 13:32
But what about my other problem?

STOP reading my signature!
Zeus
19
Years of Service
User Offline
Joined: 8th Jul 2006
Location: Atop Mount Olympus
Posted: 16th Nov 2007 02:22
FIXED, Please Lock.

STOP reading my signature!

Login to post a reply

Server time is: 2026-07-05 17:55:43
Your offset time is: 2026-07-05 17:55:43