The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • Pages

  • All categories

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

    Join 1,854 other subscribers

Archive for the ‘Delphi’ Category

Happy Delphi 25th anniversary: follow hash tags #Delphi25 and #Delphi25th

Posted by jpluimers on 2020/02/14

I wish I could have prepared something more substantial for the 25th Delphi birthday.

Alas: life has been tough (see below), so please keep an eye on these search terms, hash tags and start posts from past Delphi team key members:

Search term: “Interview with Anders Hejlsberg and Chuck Jazdzewski #Delphi25th”; highlights from it:

  • “The men in this video are responsible for an incalculable amount of software, in one way or another. It boggles the mind to think about their impact on our industry.
    I know, right? If you aren’t using software they were directly involved in, then you are using software inspired by their software.”
  • Delphi 1 being postponed 6 months to ensure the visual designer and live data worked properly; the side effect was top notch quality of other product areas
  • Shipping the RTL and VCL code was very important
  • “If it was done right, we wouldn’t have a job” – had me truly LOL! It is so true! The Windows API was powerful, but hard to use – slightly better today, but still Delphi run circles around any other UI for Win32 tool – VB included.
  • Method Pointers changed the perspective of a lot of software development, even outside the Delphi world
  • Peter Sollich working on the compiler (Wish Peter Sollich was mentioned more; he was instrumental to the compiler.)
  • Garbage Collection is beautiful, but adds a truckload of complexity interfacing to the non-garbage collected underlying Windows API
  • The power of the VCL component model working irrespective of the state (having a Windows Class, Window Handle, etc) of the underlying Windows controls
  • The automatic recreation of underlying controls when certain component properties change is still important today on the supported platforms, for instance when switching from landscape to portrait mode
  • Reference counting (which was already with large strings) only gets you so far, as it can leave isolated islands that never get collected; mark and sweep was hardly used in any other environment
  • The beta/field-test/code names (like Delphi, Wasabi, Mango) depended on the group of people they were sent to
  • “Very important was that the Delphi 2.0 compiler and VCL was long underway before Delphi 1 was released. That made the transition from Win16 to Win32 so much easier.
    Yes, and really interesting in terms of strategic planning”
  • “I think Monet was ObjectVision 1.0 I think -and ObjectVision 3.0 was bundle with TurboC as I remenber it – I was PM on that in Scandinavia. :)”
  • Chuck is now working at Google on a new framework for Android Development called “Compose”.
  • Anders worked for a short while on Visual J++, then on C# and .NET, then adding TypeScript, and helped Microsoft move from inward oriented company to opening up to open source. He now spends his time committing code to github (github.com/ahejlsberg) because he wanted to go back to coding instead of managing.
  • “If playback doesn’t begin shortly, try restarting your device.” It stopped playing as soon as you switched to YouTube.
    Sorry. Must be a network issue. We will send out a replay link.”
  • “The first time I used Pascal, it was Compas Pascal – also written by Anders Heijlsberg. Now he is behind C# and TypeScript – he surely is leaving a major mark on the runestones of software development!”
  • DogFood is important; Turbo Pascal and Delphi were among the first; C# and TypeScript now do this too.
  • “Will the anniversary page Delphi.embarcadero.com be available in future also ?
    Yes, that is the plan. We made it Delphi.embarcadero.com instead of Delphi25. so we can keep it around. Plus we have more content comming on there.”
  • The Delphi compiler version actually started at 1.0 for Turbo Pascal 1.0
  • “Official MS Windows Me image for Virtual Box can be found at https://archive.org/details/win_me_archive_vdi
  • DavidI: Special respect to my “Twin separated at birth” Charlie Calvert for training the world on Delphi !!!
  • [WayBack] (PDF) Borland Software Craftsmanship: A New Look at Process, Quality and Productivity
    A:This is a great paper. By coincidence I actually saw it less than two days ago!
  • “Don’t forget Cary Jensen, I have met him at the first Delphi courses in Amsterdam ~24 years ago. I hope he is well!”
  • “Don’t forget InterBase has been there all the time along the way too! And still going strong, and across all the same target platforms!”
  • “How about a line profiler built-in, rather than having to purchase and install AQTime?”
  • “This site has VirtualBox virtual machine images for all legacy versions of Windows, including “Window 3.1” … http://virtualdiskimages.weebly.com/virtualbox.html
  • “I agree with the very useful feature of being able to make Windows versions of the mobile apps. This is one, that is being used exactly for that… multipurpose. https://play.google.com/store/apps/details?id=com.danvaegt.SmartWeighClient

A few of my recent tweets:

 

Delphi 25th pages

Read the rest of this entry »

Posted in Delphi, Development, Software Development | Leave a Comment »

Reminder to self: be aware of implicit setup/tear down code in methods

Posted by jpluimers on 2020/02/13

If a part of a method requires implicit setup/tear-down code (for instance when using managed types like arrays, strings, etc), especially in rarely taken execution paths, then consider putting that code in a separate method.

I bumped into this recently, and found out it does not just hold for Delphi, it can happen in other languages too.

A Delphi example I found back is this one: [WayBackDelphi Corner Weblog: Speed problems caused by code that never ran.

The problem with Delphi is that the language does not have local scope (variables are at the start of the method) which means the penalty is for the full method.

I bumped into this in C# where a piece of legacy code had the variables declared away from the block where they finally were used.

This historically grew, because originally they were used in more placed of the code.

The refactoring limiting the scope just never put the declaration close to the usage hence violating the proximity principle.

Via: [WayBack] Ouch! Code that doesn’t get executed can still cause other code in the same procedure to become much slower. Of course, in retrospect, once you know the… – Thomas Mueller (dummzeuch) – Google+

–jeroen

Posted in .NET, Delphi, Development, Software Development | Leave a Comment »

Delphi desktop settings: .DST naming limitations and content similarity to .DSK files

Posted by jpluimers on 2020/02/12

Based on [WayBack] Bummer, cannot save a Delphi desktop named “Default Layout – right 3/4” – at load this one seems to be restored, but the list does not contain that entry. – Jeroen Wiert Pluimers – Google+:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Catch Me If You Can: LLVM back-end cannot catch all exceptions

Posted by jpluimers on 2020/02/11

[WayBack] Catch Me If You Can:

the LLVM backend cannot return from a hardware exception (like AV) if the hardware exception is raised directly within a try...except block. It can only safely return if there is a function (method) call within the try...except block.

Via and by [WayBack] Dalija Prasnikar – Google+

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

Is there a keyboard shortcut to go to the next/previous compiler error in the current …

Posted by jpluimers on 2020/02/11

Via: [WayBack] Is there a keyboard shortcut to go to the next compiler error in the current source file? – Jeroen Wiert Pluimers – Google+:

Primož Gabrijelčič:
Alt-F7, Alt-F8 IIRC

And indeed, it is sort of documented as of Delphi 2007 for “Message View”, but appears to be a much older shortcut:

I also completely forgot the compiler output is indeed a “Message View”.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Delphi Berlin and up without disabled Castalia: Use Ctrl+W to select content in the IDE code editor. Place your curso…

Posted by jpluimers on 2020/02/06

If you have enough guts to keep Castalia enabled and have Delphi Berlin or higher, then you can use this shortcut:

[WayBack] Tip: Use Ctrl+W to select content in the IDE code editor. Place your cursor some random piece of code, preferably deep in code that have nested block… – Lars Fosdal – Google+

–jeroen

Posted in Castalia, Delphi, Development, Software Development | Leave a Comment »

The magic Delphi ReturnAddress intrinsic

Posted by jpluimers on 2020/02/05

I could not find any official place where ReturnAddress is documented even though it is used at quite a few places in the RTL, VCL, FMX and 3rd party libraries like DUnitX, Spring4D, JCL, ReportBuilder, TeeChart.

I tried searching it in the contexts of Delphi 2007, Delphi 2009, but there is only a [Archive.is] different System.ObjAuto.TParameters.ReturnAddress documented in XE2 and higher.

procedure Abort;
begin
  raise EAbort.CreateRes(@SOperationAborted) at ReturnAddress;
end;

There is a (usually broken*) ReturnAddr function used in various places of the RTL/VCL/FMX and (therefore wrongfully copied) in many other peoples code.

  function ReturnAddr: Pointer;
  // From classes.pas
  asm
    MOV     EAX,[EBP+4] // sysutils.pas says [EBP-4], but this works !
  end;
  • See the above link; I think this was fixed in Delphi XE, but the issue is still open.

Related to the above is the documented ExceptAddr.

I’ve used this in my ExceptionHelperUnit to build a GetStackTrace function in the example gist below.

I found these posts documenting the behaviour of the above intrinsic functions and more:

–jeroen

Read the rest of this entry »

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Delphi: Bezier in FMX

Posted by jpluimers on 2020/02/04

In case I ever need to do some Bezier curve coding in Delphi: [WayBack] GitHub – zhaoyipeng/FMXComponents: Firemonkey Opensource Components

Via: [WayBack] Interesting set of components for FireMonkey – Christen Blom-Dahl – Google+

–jeroen

Read the rest of this entry »

Posted in Delphi, Development, FireMonkey, Software Development | Leave a Comment »

Some ideas on using DataSnap as a data-conversion layer between two systems

Posted by jpluimers on 2020/01/30

For my link archive as it contains some interesting ideas on how to use DataSnap as a conversion later between two systems: [WayBack] I need to write some DataSnap “middleware” between Google Glass and a SwissLog ERP system, and I am trying to figure out if there are significant differ… – Lars Fosdal – Google+

The ideas is basically a session based protocol converter.

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

OMF, COFF and the 32-bit/64-bit Delphi or C++ compilers

Posted by jpluimers on 2020/01/29

Via [WayBack] As far as I can tell (and documentation on that is reaaaaaaly hard to find), dcc64 can link in .obj files in OMF and COFF format. Bcc64 uses LLVM chain and therefore produces ELF .o files… – Primož Gabrijelčič – Google+:

David Heffernan:
dcc32 does coff and omf, dcc64 only coff

and later he commented:

One of the difficulties with linking objects is the handling of exceptions. The 64 bit exception model is table based, in contrast to the stack based 32 bit model.

I don’t think that the exception tables are written correctly for code linked in objects. If exceptions are raised then this can lead to abnormal process termination. Process just disappears. Poof!

One common way that this happens is floating point exceptions that are by default unmasked by the Delphi RTL. I have found it necessary to mask them when calling into any linked object code to avoid exceptions being raised.

And compiling with cl can be a bit of a game. It’s stack checking options need to be disabled. And there are a few other key switches that help. And then there’s the forward declaration trick to help the one pass compiler cope with C objects that are expected to be linked in a separate step.

Anyway, it can be quite a challenge at times, but I’ve yet to find a plain self contained C library that has defeated me!

–jeroen

Posted in C++, C++ Builder, Delphi, Delphi x64, Development, Software Development, Visual Studio C++ | 2 Comments »