Avatar of starhu
 asked on

Condition define problem in multi programming environment


We have a big application with a lot of conditional defines (which tell the compiled units).
The real situation is much more complicated than the example below but it will help you understand the problem:

- Let's say that we have 3 main units: main1, main2, main3.

- In each of these units uses section are common units and conditional units, e.g.

   MyData, MyProc


,Borrow2, Borrow3

Open in new window

The problem is this: two programmers work on the same project but one with SERVICE_MODULE, the other with BORROW_MODULE;

If the first builds the program, then when the second programmer runs the program from Delphi, there is a message that ServiceMain doesn't exist in the project.
If he builds the project, everything would be fine for him, but then the first programmer would get the message: Borrow1 doesn't exist in the project.... and so on..

What is the easiest way so as the two programmers can work on the same project without bothering each other?
(very often both modify the common units too, of course after conciliation)

Thank you

Avatar of undefined
Last Comment
Geert G

8/22/2022 - Mon
Sinisa Vuk

Best approach is to use SVN or similar source version control.
Very popular is: https://subversion.apache.org/

SVN can merge project into one. If you want to use definitions, then each programmer must have own dproj/project definition file where is under DCC_Define (or in Project/Option/Conditionals) set one one case SERVICE_MODULE and BORROW_MODULE in another. This can be done in include .inc file too like this:

unit main1;


{$I CompileSett.inc}

Open in new window

where CompileSett.inc is a file in project folder for one programmer:

Open in new window

... and for another...


Open in new window

... and naturally, all usage of units ServiceMain, Borrow1, .. must be inside of {$IFDEF}..{$ENDIF}

We use Windows in the office. Can it be used with Windows, too?

Thank you

I found this "how to" link: http://www.wikihow.com/Install-Subversion-on-Windows-7

Is this the subversion you wrote about?
Your help has saved me hundreds of hours of internet surfing.
Sinisa Vuk

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Geert G

Get rid of the conditional defines. They are the cause of your problems and not necessary.