The Wiert Corner – irregular stream of stuff

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

  • 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,860 other subscribers

Archive for the ‘Delphi 4’ Category

Happy Birthday AppBuilder^H^H^H^H^H^H^H^H^H^H Delphi

Posted by jpluimers on 2015/02/14

Normal people would give Valentine presents today.

But 20 years ago, Borland thought it was a nice idea to release Delphi. Then a revolutionary new tool and lots of scepticism. Now – after 20 years – still going strong, despite all kinds of funny things that management at Borland, InPrise, etc did and the wild ride the market had.

Happy birthday Delphi!

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 2 Comments »

My wish for Delphi: Please bring multi-level undo/redo functionality in the Delphi designer (form, datamodule, etc).

Posted by jpluimers on 2015/02/13

After a hectic week bringing back memories from a long time ago, I remembered the really early Delphi days.

Long before [WayBack] QC2747, back when it was still called AppBuilder, several people – including me – made the wish for an undo/redo functionality on the Delphi compuserve board.

Back then, the argument was that the designer needed to be restructured to do that. Now that it has – to accommodate FMX – and it is time, especially for the vast majority of Delphi users primarily using the designers to get work done.

So my wish, after 20+ years of Delphi use:

Please bring multi-level undo/redo functionality in the Delphi designer (form, datamodule, etc).

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | 2 Comments »

Which Delphi extensions to (not) put in version control: Delphi File Extensions – Delphi Programming (via Delphi.wikia.com)

Posted by jpluimers on 2014/12/10

Convenient list to decide what to put in your version control system: Delphi File Extensions – Delphi Programming.

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | Leave a Comment »

Delphi: removing “unused” units from uses lists cannot be fully automated (via: SO)

Posted by jpluimers on 2014/11/11

One of the things a lot of Delphi users want is to be able to automagically remove unused units from their uses lists and projects.

The short answer is: you can’t.

The long answer starts with: you can’t fore a number of reasons.

Similar reasonings hold for many other development environments. Plain Windows EXEs and DLL dependencies. .NET projects and assembly dependencies, etc.

Initialization/Finalization dependency

The first reason is that each unit (module, assembly, or other dependency) can contain global code to be executed at unit start/load or finish/unload.

So even though you do not reference anything inside that unit, the initialization and finalization sections can be run.

Removing the dependency from your units and project, kills that functionality. And might break all sorts of things.

Load order dependency

Sometimes you have subtle load order dependencies of units. Those should be rare, and if they are there, should be enforced by the affected units themselves. But everyone knows those subtle dependencies are more often a by product not enforced by anything than coincidence.

So if you start removing references, the load order might change, and subtle bugs may occur.

In other words: test, test, test and test your codebase before and after removing unit references from uses lists.

Parsing

If you understands the dependencies of initializtion/finalization or load order, you will get interested to know what units are actually being used.

The ultimate source for this would be the Delphi compiler. Bad luck here: you cannot use it as the IDE and command-line interfaces don’t offer a hook to it to do just this.

So you need alternative parsers that can help out. The answers to How to remove unused units from all source files on Delphi XE2 describe a few and they all have the same drawback: they are not the Delphi compiler, so they are a rough approximation of what the compiler would do.

And even if the approximation would be perfect, they all suffer from the same thing the compiler suffers from: you can only have one set of conditional defines, platforms, etc at the same time.

There is lots of code for which the usage is conditional, but where the uses list does not reflect this.

Fazit

Optimizing uses lists to eliminate unused units seems a simple thing at start, but isn’t.

The best way to keep those optimized is to prune them while developing. So if you remove code, try to remember cutting down the uses lists by hand.

And then test, test, test and test your codebase.

–jeroen

via: ide – How to remove unused units from all source files on Delphi XE2? – Stack Overflow.

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 8 Comments »

Windows .RES/Resource editors

Posted by jpluimers on 2014/11/07

While researching the manifest problem I will post about next week, I made a short list of free Windows Resource Editors:

All other resource editors I found were not free, and someof them not maintained for an even longer period than the free ones.

–jeroen

Posted in Delphi, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Power User, Software Development, Windows, Windows 7, Windows 8, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | 4 Comments »

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….

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 5 Comments »

Barry Kelly on how the Delphi Compiler used to be compiled (via: Google Groups)

Posted by jpluimers on 2014/10/23

not 100% accurate any more (now that the compiler gets more and more LLVM), but still accurate for most of the x86/x64 parts: Barry Kelly explaining how the Delphi compiler is built.

Some more of his posts.

–jeroen

via: Newbie question: What is the importance for a compiler to be able to compile itself? – Google Groups.

Posted in Delphi, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 2 Comments »

Delphi: RandomizeIfNeeded

Posted by jpluimers on 2014/10/07

Calling Randomize too often can make your Random numbers even less random.

Sometimes having the Randomize call in a unit initialization section is not practical.

Hence this little method that I think I first wrote back in the Turbo Pascal days:

procedure RandomizeIfNeeded();
begin
  if RandSeed = 0 then 
    Randomize();
end;

–jeroen

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi for PHP, Delphi x64, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Pascal, Software Development, Turbo Pascal | 7 Comments »

Delphi: always watch the compiler Warnings

Posted by jpluimers on 2014/08/28

Quiz questions:

  1. Does the below unit test succeed or fail?
  2. Why?
procedure TestHResult.Test_EOleException;
var
  OleException: EOleException;
  IResult: LongInt; // == HResult
  UResult: Cardinal; // == DWord
begin
  IResult := $800A11FD;
  UResult := $800A11FD;
  try
    OleException := EOleException.Create('message', $800A11FD, 'source', 'helpfile', -1);
    raise OleException;
  except
    on E: EOleException do
    begin
      if E.ErrorCode = $800A11FD then
        Exit;
      Self.CheckEquals(E.ErrorCode, $800A11FD, 'E.ErrorCode should equal $800A11FD');
    end; // E: EOleException
  end;
end;

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Event, Software Development | 2 Comments »

JEDI.INC got updated a few months ago: Delphi XE7 seems to be ahead…

Posted by jpluimers on 2014/08/22

While updating a project to a more recent version of Delphi, I also updated the JEDI.INC reference.

Note that since writing Delphi – finding the VERxxx define for a particular Delphi version: use JEDI.INC, the Delphi JEDI project moved from SoureForge to GitHub.

The fun thing: JEDI.INC got updated a few months ago to support Delphi XE7 provisionally.

Given the Delphi release cycle of twice a year, the Delphi Carpathia aka XE7 rumours this summer, I presume Delphi XE7 is near because of:

By then the list of Delphi Versionen | Delphi-Treff will likely also be updaed.

I’m anxious to see if the (Dutch + English) BIG Delphi Conference organized by Barnsten and Blaise from September 11-12 in the Netherlands will be part of the launch tour.

Anyway: here is the JEDI.INC portion with defines:     Read the rest of this entry »

Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development | 6 Comments »