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.

Author
Message
Suicidal Sledder
21
Years of Service
User Offline
Joined: 17th Aug 2004
Location: Tikrit, Iraq
Posted: 1st Feb 2007 16:31
This is in reguards to my recent RPG that u probably have seen the other posts about. Since I've never used the #INCLUDE command I juat had a few questions about it. The long and the short of it is for every navigational screen it takes a few hundred lines of code and since I was planning on have hundreds of navigation screens.... well, do the math.

Can I save the individual screen codes as seperate files and then just #INCLUDE them in the main? I'm not using functions I'm using subs. I searched and found that it sometimes causes loss of code?? Has that bug been fixed in v6.4?

And finally, is there a limit as to how many files I can #INCLUDE?

thanks so much,
-SS

>>STAR RUNNER<<>>Full game<<>>Several Features<<>>Small download>>
http://forum.thegamecreators.com/?m=forum_view&t=98944&b=5
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Feb 2007 16:51
In DB Pro, you don't #include. You add additional dba files using the editor.

For functions, it's fine. I would imagine it's OK for subs too, but I don't use them.



Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 1st Feb 2007 16:56
Click on the files tab at the bottom right of the screen. Here you can include source files or create new ones. Once you've created a new file you can switch between them(look at pic). Each time you load up your project in the editor just go to files again to access the file you need.
Jack LOL
19
Years of Service
User Offline
Joined: 4th Aug 2006
Location: Near the CPU Close to the graphic card
Posted: 1st Feb 2007 17:01 Edited at: 1st Feb 2007 17:14
1. Dont use the #include function. include them as source files in the project instead.
2. When u include the source files in the project and u have constants and arrays declarations use gosub from the main source to the start of the source files.



RiiDii
21
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 1st Feb 2007 17:36
I would like to know (for sure)... Wouldn't Include load in the source files at the time of compiling and compile the entire project to include all the Include-d files? So, it really should not make too much a difference; except, of course, when trying to compile multiple source files again and again for a project with something like 60k+ lines of code.


Open MMORPG: It's your game!
dark coder
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 1st Feb 2007 17:57 Edited at: 1st Feb 2007 17:57
No because the IDE doesn't open the file and tell you where the error is, which is why you shoulden't use #Include.

Cash Curtis II
21
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 1st Feb 2007 18:25
Using the #include command is only suitable for pre assembled code libraries that you won't be changing at all for the reason the Dark Coder said. IDE includes are easy to use, and aid in project development and organization. If you use CodeSurge as your IDE, it will correctly identify the location of your error.


Come see the WIP!
wildbill
20
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 1st Feb 2007 18:29
Use "Code Surge" IDE. I currently have a project with several seperate include files and it works perfectly. It's easy to navigate back and forth also.
Agent Dink
22
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 1st Feb 2007 21:21
Iclude files are awesome. I use them all the time. It keeps everything neat and orderly and there is no searching through miles of code. You simply click the included file in the list and jump right to where you want to code. I love them so much. The only issue is that the default IDE doesn't tell you where the error is correctly. That is frustrating, but worth the effort to me. I may try CodeSurge though. It looks very promising!

Sometimes the only way over a wall is to pile up enough bodies to climb over - Dave W.

Login to post a reply

Server time is: 2026-06-26 12:17:05
Your offset time is: 2026-06-26 12:17:05