Archive for the ‘Borland Pascal’ Category
Posted by jpluimers on 2014/02/13
Summary: Always try to avoid sharing .DCU files between projects.
I see a lot of projects at clients that do not have their individual DCU directories set (therefore having the DCU files in the same directory as the PAS files causing shared units to share the DCU files), or share DCU files among different projects.
Both are a very bad idea, as the compiler does not always understand when the DCU file does not match the combination of PAS file and compiler options.
The result is the occasional use of the DCU file in stead of the PAS file causing wrong code to be used, or wrong debugger information to be included.
Danny Thorpe phrased it on Stack Overflow: Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, 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, Development, FreePascal, Lazarus, Pascal, Turbo Pascal | 9 Comments »
Posted by jpluimers on 2013/12/19
Another episode in the Missed Schedule series that was originally scheduled for 20131201:
Until I read the comments at Monitoring the Monitor, I only knew the early days of Matt Pietrek‘s work at NuMega and as co-author of one of the first Undocumented Windows books (another one appeared about the same time).
Now I know Matt was one of the people interviewing Allen Bauer for his first position at Borland.
A bit more search revealed Matt worked at Borland from 1988 until 1992, roughly the era from Turbo Pascal 5 until Borland Pascal 7 (when Borland already had started researching Delphi), but more importantly with Turbo Debugger versions 1-3 that were indispensable when programming using Turbo C / Turbo C++ and Borland C++.
When Borland was working in Delphi 95, and Microsoft on Windows 95, he moved to Nu-Mega (later Acquired by Compuware) doing lots of work in debuggers.
Some interesting links from or involving Matt:
–jeroen
Posted in Borland Pascal, Debugging, Delphi, Delphi 1, Development, Pascal, Software Development, Turbo Pascal | 2 Comments »
Posted by jpluimers on 2013/12/19
Almost a year ago, a thread on “premature Delphi optimization” came by on G+ about this code:
procedure ExchangeInteger(var AValue1, AValue2: Integer);
begin
AValue1 := AValue1 xor AValue2;
AValue2 := AValue1 xor AValue2;
AValue1 := AValue1 xor AValue2;
end;
I don’t think that was premature optimization, just some code from an old fart that had already been programming in the era where processors had reasons to use it:
Back then, the only efficient way to exchange two variables of the same data type was using the XOR swap algorithm.
Nowadays you have more options, and this is where the fun in that thread began, which I will show in a minute.
First a bit of history
The XOR swap algorithm was widely known in the 80s of last century and before, especially because the 6502 processor (oh the days of LISA Assembler) was vastly popular, as was the Z80. Together, they powered the majority of the home computers in the 70s and 80s.
Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, 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, Development, History, Pascal, Software Development, Turbo Pascal, UCSD Pascal | 7 Comments »
Posted by jpluimers on 2013/08/12
While researching some other historic information about Delphi, I bumped into this thread: New DPMI host – delphi.
If is a small thread describing what kinds and versions of DPMI hosts were available to run Turbo Pascal based programs.
DPMI stands DOS Protected Mode Interface: a way for real mode DOS programs to access protected mode features (mainly memory above the 1 megabyte barrier).
I had plainly forgotten that the DPMI host shipped with Delphi 1, and wasn’t aware you could have a 32-bit DPMI host at all.
Some other memory related abbreviations from that era: Read the rest of this entry »
Posted in Borland Pascal, Delphi, Delphi 1, Development, Object Pascal, Pascal, Software Development, Turbo Pascal | 2 Comments »
Posted by jpluimers on 2013/03/27
As I wrote before, I’m with the [WayBack] Delphi with haters camp, and this is why:
Using the [WayBack] with statement in Delphi makes your code less future proof.
Originally, the with statement in Pascal was argumented in part of allowing compiler optimisations:
PASCAL User Manual and Report – Kathleen Jensen, Niklaus Wirth – Google Books
The with clause effectively opens the scope containing field identifiers of the specified record variable, so that the field identifiers may occur as variable identifiers. (Thereby providing an opportunity for the compiler to optimize the qualified statement.)
Screenshots of this 1975 book are below the fold.
The Delphi (actually even before that Turbo Pascal compiler) has no measurable difference between with and non-with code.
The debugger however, still does not support with, and there are other drawbacks of which one is below.
The below code example is just one of many. I show it because I recently bumped into doing some long overdue code porting to Delphi XE3.
Since I’ve been bitten by using with a couple of times before, it didn’t take me long to find the cause.
Example code where FIConData is of type NOTIFYICONDATAW that used to compile fine:
with FIconData do
begin
cbSize := SizeOf(FIconData);
Wnd := Self.Handle;
uID := $DEDB;
uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
hIcon := Application.Icon.Handle;
uCallbackMessage := WM_CAS400NTIcon;
StrCopy(szTip, PChar(Caption));
end;
Well, as of Compiler Version 20, it doesn’t compile any more. Read the rest of this entry »
Posted in Borland Pascal, Conference Topics, Conferences, Delphi, Delphi 1, 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, Development, Event, Pascal, Software Development, Turbo Pascal, With statement | 32 Comments »
Posted by jpluimers on 2013/02/20
Right now, documentation on Delphi Conditional Defines is on pages like Conditional compilation (Delphi) – RAD Studio XE2, but it is limited as it is for one specific version of Delphi only.
However, over the course of Delphi versions, compiler platforms and bitness, and not forget Free Pascal and Turbo Pascal/Borland Pascal, the matrix has become huge.
There is no complete documentation on that in one place. Right now include files like Defines.inc, the DSPack.inc, the JCL include directory the JVCL common include directory and the Jedi.inc documentation contain the collective knowledge about this.
Someone should condense that in a table and – more important – keep it up to date.
At least now there is a post collecting some of the links that contain the knowledge (:
Found one that contains these columns
- Product & Version
- VERxxx defines
- __BORLANDC__ value
- RTLVersion
- CompilerVersion
- Package Version
via Compiler/RTL version overview « Muetze1 wich is now available on the wayback machine: http://web.archive.org/web/20131229055045/http://www.muetze1.de/?page_id=547
–jeroen
Posted in Borland Pascal, Delphi, Delphi 1, 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, Development, FreePascal, History, Pascal, Software Development, Turbo Pascal | 14 Comments »