Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delphi 7 - create a custom warning

I'm using Delphi 7, and I want to create a custom warning message (which will be shown at compile time), so I can warn other programmers on some modifications. I've searched on the internet but I didn't found anything relevant.

Other solutions, are welcomed as well, as long other programmers are warned about things I want, when they compile/build the sources.

like image 705
RBA Avatar asked Oct 06 '10 10:10

RBA


3 Answers

We use $MESSAGE too, but with the WARN directive. Typically to alert developers to not implicitly compile units directly into their exe/bpl if it's already contained in another BPL that they should use as a package. D2005 here.

{$MESSAGE WARN 'File: FOOUNIT contained in PACKAGE:-> FOOLIB'}
like image 67
Chris Thornton Avatar answered Oct 25 '22 12:10

Chris Thornton


In D2007 you can write

{$MESSAGE 'Hello'}

or

{$MESSAGE ERROR 'Hello'}

- see the documentation. This works since D6 (info courtesy of Sertac Akyuz).

like image 31
Uli Gerhardt Avatar answered Oct 25 '22 13:10

Uli Gerhardt


Sometimes I also wish that such a feature exists. Unfortunately I don't know any solution that could handle my requirements.

The best approach I could imagine spontaneously would be a separate message file which will be synchronized by an IDE Expert. You can add a new message to this file with this expert like this

new DevExpress components (Build 123) required

and commit it to the VCS repository. After the other developers update their local working copies, the IDE Experts compares and synchronizes the message file with a local copy and displays the new messages.

like image 24
splash Avatar answered Oct 25 '22 12:10

splash