The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,798 other followers

Delphi; Conditional defines in the .dpr: FastMM4 disappearing – via: G+ I’ve got an old problem, in which the IDE…

Posted by jpluimers on 2014/11/05

Vin Colgin posted on G+:

The kind of text that the Delphi IDE often removes in a .dpr file.

The kind of text that the Delphi IDE often removes in a .dpr file.

FastMM4 and lines in the *.dpr

I’ve got an old problem, in which the IDE will take the lines required out of the “uses” clause in the *.dpr. Something I’m sure we’re all aware of, but is there a solution to keep it from doing it?

The comments indicate the problem is less severe in more recent Delphi versions:

Daniela Osterhagen Actually it has become much better. The IDE doesn’t meddle as much with the DPR files as it used to.

One option for solving this issue is adding a new unit as the first entry that permanently stays there and moving the ifdef to that unit.

That’s what I did a long time ago and even put on-line, and even put it on-line at CodePlex as FastMM4BootstrapUnit.pas (now moved to bitbucket as FastMM4BootstrapUnit.pas). Too bad CodePlex and BitBucket are not indexed on Google, so I commented this:

I’m using a FastMM4BootstrapUnit for that at the top of my DPR; it  looks like this […]

It will eventually end up at my BeSharp.net repository any way.Let me know if you need it there soon, and I can probably get something published after the Entwickler Konferenz next week.

So various people are now using this:

  • Vin Colgin:  very nice. Thanks for the tip!
  • Warren Postma: This works fine for me in xe6 and up.
  • Bruce McGee: Nice. May I steal this? And by “steal”, I mean giving credit in the code comments.

Since I could use this unit during my EKON 2014 talk about Delphi Unit Testing, I expedited the publication:

https://bitbucket.org/jeroenp/besharp.net/src/tip/Native/Delphi/Library/FastMM/FastMM4BootstrapUnit.pas

And explained the usage in this Unit testing session session materials.

Note: this file isn’t indexed either (as BitBucket doesn’t allow it), but since the repository will be git based in the foreseeable future anyway, I can then move it to GitHub which does allow Google to crawl the master branch.

–jeroen

via FastMM4 and lines in the *.dpr I’ve got an old problem, in which the IDE….

5 Responses to “Delphi; Conditional defines in the .dpr: FastMM4 disappearing – via: G+ I’ve got an old problem, in which the IDE…”

  1. David Heffernan said

    @Remy No, I was referring to the FastMM4BootstrapUnit.pas unit

  2. David Heffernan said

    What are those Indy units doing. That seems odd. I personally use a unit alias for this need.

    • David, I assume you are referring to Indy’s DPKs that use IFDEFs around platform-specific items in the ‘requires’ and ‘contains’ sections? That is mainly because Indy’s package hierarchy predates Delphi’s multi-platform features. We just have not gotten around to re-organizing the hierarchy yet so Indy has platform-specific DPKs.

    • jpluimers said

      The unit still needs some cleanup and documentation. As soon as time permits I’ll add that, and write a more elaborate article around it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: