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 / Keep code in separate files

Author
Message
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 20th Mar 2004 17:35
I would like to keep code in different files,
Example:

MAIN FILE:
Sync on
Sync rate 60
bla bla bla
LOAD FILE "battle.dba"
LOAD FILE "inventory.dba"

Is this possible? or do I have to make functions?
PURSUE YOUR DREAMS, Cheers, CyberMind
Code Ninja
21
Years of Service
User Offline
Joined: 17th Dec 2003
Location: AZ, U.S.
Posted: 20th Mar 2004 17:43
that'd work... i think... you might have to make the code a function in the file then use the #include command to make it so that you can call the function from the file.

PC: Pentium II, 333Mhz, 128 Mb SDRAM, 20 & 4Gb hard drives, 8Mb Videocard, DBC 1.13
~Dragael Software
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 20th Mar 2004 17:52
thanx
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 20th Mar 2004 20:53
If you wanted to have DB actually execute the code in the files, you wil probably have to use #INCLUDE "batt.dba". Because there is no easy way to take stuff from strings and run it through the compiler.

Crazy Donut Productions
Current Project: KillZone
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 20th Mar 2004 22:15
already done that

Login to post a reply

Server time is: 2025-05-31 17:40:19
Your offset time is: 2025-05-31 17:40:19