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 / anyway to have dbp read code from a text file outside the exe??

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 13th Feb 2006 19:54
my gosub to load the world is getting very long,i was wondering if theres some way to make dbp read code from a text file.

is there??
Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 13th Feb 2006 20:20 Edited at: 13th Feb 2006 20:21
I know you can read text files, but I dont think you can read code from it, but I might be wrong. What I do know is that you can load values with for example arrays (saving). Dont know if thats what you need or want. Goodluck with your game/program.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Feb 2006 21:49
If its a matter of neatening up the code you can create multiple source files and then use the Project Manager to include them with the Dark Basic Project.

Now that I think of it, if you did want to use text files instead, you might be able to put the code in a text file, save it as name.dba and then include that in your code. You could even have the user input the code in a dbp program and then save that code to a source file. Woah! I just got an idea......

David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 14th Feb 2006 00:17
thanks!well i was just thinking i have a gosub that dbp runs only once,(loads the worlds),why should it take up space in the code?might be better to have dbp run it from an outside text.ill try your suggestion.whats your idea btw?share.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Feb 2006 10:50
Do a search for Magic World. It uses a text file with all the objects, positions, ettributes etc. There is also an include file of 50 or so lines that reads the text file and builds the world.

http://www.robinking.com/allseeingi/

Login to post a reply

Server time is: 2024-11-27 06:38:19
Your offset time is: 2024-11-27 06:38:19