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 / question on executing(running) a single module

Author
Message
mirrellk
13
Years of Service
User Offline
Joined: 2nd Mar 2011
Location:
Posted: 12th Mar 2011 22:26
Hi All-

I really hate to as a question like this, but it really isn't obvious to me. If I have 5 programs in my project and want to compile and execute just a particular one, how can I do that?. I
tried by settin the module I want to compile/run as the main file, but it still seems to compile/execute all programs...Please advise on what I am missing.

Thanks!!!!!

mirrellk
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 12th Mar 2011 22:42
A project is a single program - how do you have 5 programs in a single project?

Can you explain using a project you upload here? (Pack it up in a zip file, and just have your programs print something and pause).

mirrellk
13
Years of Service
User Offline
Joined: 2nd Mar 2011
Location:
Posted: 13th Mar 2011 01:55
Hi IanM -

Actually, I have my program, DarkData.dba and all the example programs from BBB gui in my project...I am cutting and pasting code from those examples into my program...Thinking of other Languages that I use at work like Cobol & Java, Cobol uses subroutines(and calls) and Java calls methods in other classes...in DarkBasic wouldn't you still want to use common subroutines across projects?...for example, if you wanted to use the same data calculation or a highscores routine why cut and paste this code in-line creating one massive program...I an anxious to hear your thoughts on this...Thanks for responding!!

mirrellk

mirrellk
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 13th Mar 2011 10:11
In DarkBASIC, you can re-use code like that by pasting it or attaching it in seperate DBA files to your project. But you can only have one project (DBPRO file) opened at one time. When you compile it, you compile the whole project. And it's just like all those extra source files are stuck on the end of the main source file in one big program.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Mar 2011 18:07
@mirrellk,
That's modular programming you are describing now, and that doesn't quite match with your first post.

A level of modularity is possible in DBPro, but rather than go through it here, I'll direct you to another discussion I was involved in a month or so back: http://forum.thegamecreators.com/?m=forum_view&t=180209&b=1

One thing I'd say to you while you read that, is that my posts are just my opinions - read through the posts and pick the techniques that work for you.

mirrellk
13
Years of Service
User Offline
Joined: 2nd Mar 2011
Location:
Posted: 16th Mar 2011 15:14
IanM -

I read that thread and I completely agree with you, but it now makes me think the real problem lies within the DarkBasic IDE itself...In otherwords, I can develop X number of reusable modules in my project, but I cannot compile them or run them individually, because the DarkBasic IDE simply does not have that functionality...basically it is an all or nothing scenario...would you agree with that?...If you know a way around it let me know (possibly using another IDE?)...what I do not want to do is to break every module I write into a separate project, that would be VERY tedious...

Thanks for all your help!!!
mirrellk

mirrellk
Frank C
14
Years of Service
User Offline
Joined: 3rd Jul 2010
Location: Houston TX
Posted: 16th Mar 2011 19:08
If you open your .dbpro file in the editor you will see where it lists all the source files it tells the compiler to combine together, if you only want to compile one of them make it the main file then open the .dbpro file and comment out the others, the compiler should then ignore them.
mirrellk
13
Years of Service
User Offline
Joined: 2nd Mar 2011
Location:
Posted: 16th Mar 2011 19:32
FrankC...that makes sense...will do...thanks bud

mirrellk
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Mar 2011 21:09
If for developing or testing the module, I simply create a new project, with its own main file, then add the module in the IDE.

I simply can't understand how people develop huge monolithic chunks of code, or create new modules as a part of an existing large project - developing and testing your module in isolation is always faster and easier to write & debug. Once it's written and tested, then integrate it with your main source code. And if you hit problems with it later, you've still got the stand-alone project with its test cases for debugging.

Login to post a reply

Server time is: 2024-11-24 06:42:54
Your offset time is: 2024-11-24 06:42:54