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,862 other subscribers

Archive for the ‘Delphi’ Category

Google Search string for either docwiki, Delphi 2007 or Delphi 2009 docs

Posted by jpluimers on 2019/01/02

These search the Delphi 2007 docs:

Similar for Delphi 2009 docs

The second ones search just English, and the first searches all languages.

Given the Google search indexing, the first might give a lot of Japanese search results:

https://www.google.com/#q=site:docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4+TPanel

I made shortcuts for the English one in Chrome:

Search engine definition
Search engine Delphi 2007 docs
Keyword d2007
URL with %s in place of query https://www.google.com/#q=site:docs.embarcadero.com/products/rad_studio/radstudio2007/RS2007_helpupdates/HUpdate4/EN+%s

 

Search engine definition
Search engine Delphi 20079 docs
Keyword d2009
URL with %s in place of query https://www.google.com/#q=site:docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN+%s

 

I did the same for the docwiki (where you cannot distinguish between languages in a generic way for all Delphi versions, as the language comes after the Delphi version and the kind of documentation (CodeExamples, Libraries, etc.)):

Search engine definition
Search engine Docwiki (all EN/DE/FR/JP)
Keyword docwiki
URL with %s in place of query https://www.google.com/#q=site:docwiki.embarcadero.com+%s

Reasoning:

  • It’s the earliest Delphi version having documentation on-line in HTML format.
  • The foundations of the RTL/VCL structure has not changed since then
  • The links can be archived in the WayBack machine and still look nice after archiving (no CSS fuzz that makes archived pages hard to read)

–jeroen

Posted in Delphi, Delphi 2007, Development, Software Development | 2 Comments »

EKON 22 Slides and Code – Synopse

Posted by jpluimers on 2018/12/29

For my link archive: [WayBackEKON 22 Slides and Code – Synopse by Arnaud Bouchez.

I’ve uploaded two sets of slides from my presentations at EKON 22 : Object Pascal Clean Code Guidelines Proposal High Performance Object Pascal Code on Servers with the associated

Via: [WayBack] http://blog.synopse.info/post/2018/11/12/EKON-22-Slides-and-Code – A. Bouchez – Google+

–jeroen

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

Delphi and C++ builder Platform Status

Posted by jpluimers on 2018/12/28

Almost all pages at the Embarcadero DocWiki have an embedded product version in the URL or get redirected to one.

One of the notable exceptions is the [WayBackPlatform Status:

The following table shows supported platforms and operating systems for different RAD Studio versions.

* (star) sign next to an operating system indicates that there is a known issue with that operating system and a corresponding RAD Studio version.

To see the workaround for that particular issue, click on the name of the operating system or scroll down to the appropriate section.

It got introduced in 2015 ([WayBackNew DocWiki RAD Studio, Delphi and C++Builder Platform Status Page – Community Blogs – Embarcadero Community) and is maintained at irregular intervals.

For some history: https://web.archive.org/web/*/http://docwiki.embarcadero.com/PlatformStatus/en/Main_Page

–jeroen

via: [WayBack] Summary page showing supported platforms and OS versions for XE4 and upwards, as well as links to known issues for specific versions… – Lars Fosdal – Google+

Posted in C++, C++ Builder, Delphi, Development, Software Development | Leave a Comment »

Delphi: AutoSize property resizes a container (panel, scrollbox, form, frame…) to grow it to fit all controls

Posted by jpluimers on 2018/12/26

A while back I needed a design-time way to automatically resize a Delphi container control (descendants from the, [WayBackTWinControl Class like [WayBack] TPanel, [WayBack] TScrollbox, [WayBack] TForm, [WayBack] TFrame) to grow/shrink so it just fits around it’s contained controls.

Back then I needed it for VCL design time, if possible taking into account non-visual components.

The [WayBackTControl.AutoSize Property does just that for visual controls and works way better than suggestions on doing this manually.

Manually adjusting many controls at design time is a tedious job, especially when trying to prevent mouse usage (I’ve had RSI in the early 1990s, so I’m extra careful).

Thanks Uwe Raabe for helping me out on this.

I’ve not had the need for non-visual components or FMX yet, but if I ever need it, then this piece of code by Stefan Glienke might work:

[Archive.is[Delphi] ResizeControlEditor – Pastebin.com

–jeroen

Source: [WayBack] Is there an expert that can resize a container (panel, scrollbox, form, frame, etc) to be just large enough so it fits all it components?So: grow when… – Jeroen Wiert Pluimers – Google+

Read the rest of this entry »

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

Do not put IFDEF with relative paths in your .dpr as the Delphi IDE cannot match them in the .dproj

Posted by jpluimers on 2018/12/20

The Delphi IDE manages the .dpr and .dproj files for, trying to keep them in sync.

Some information is duplicated between the two, especially files referenced by relative paths: those files are contained in your project.

This means you cannot do something like this in your .dpr file:

  {$IFDEF DEBUG}
  Debug in '..\..\..\..\Shared\Debug.pas';
  {$ELSE}
  Debug in '..\Debug.pas'
  {$ENDIF}

There is no equivalent for this in the .dproj and it will confuse the IDE which file now actually is or is not inside your project.

Better to leave the file outside of your project, then modify the RELEASE/DEBUG search paths to have the correct one.

Even better is to have just one Debug.pas file containing the changes.

–jeroen

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

Spring4D How to correctly assign NULL to a Nullable type?

Posted by jpluimers on 2018/12/19

Since I tend to forget this: [WayBack] Spring4D How to correctly assign NULL to a Nullable type? this is correct? fDateTime = Null; or this? fDateTime := nil; – Jacek Laskowski – Google+

The preferred way is fDateTime := nil.

This is possible because of [WayBack] Delphi sorcery: How to create an operator overload that only accepts nil using a reference type (in this case interface) so no non-nil pointers can be passed:

type
  Nullable<T> = record
  strict private type
    Null = interface end;
  public
    class operator Implicit(const value: Null): Nullable<T>;
  end;

–jeroen

Posted in Delphi, Development, Software Development, Spring4D | 2 Comments »

Spring4D Conference

Posted by jpluimers on 2018/12/19

Do not forget the early bird sales ends soon for the Spring4D European Conference 2018 – Bergamo Italy, right before Easter 2019.

Both the original author and the current maintainer will be there, and it will be a great place to socialize with fellow Spring4D users.

Buy tickets: [WayBack] Spring4D Conference

Via:

–jeroen

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

Never ever put OutpugDebugString in code that is meant to run on production systems

Posted by jpluimers on 2018/12/18

I just saw this code in the Delphi RTL enabled for RELEASE builds of the procedure TThreadPool.TQueueWorkerThread.Execute; code:

{$IFDEF MSWINDOWS}
    OutputDebugString(PChar(Format('Thread Exiting: %d', [ThreadId])));
{$ENDIF}

Never, ever do this.

If you code review code that contains it: ensure it has some kind of compile time DEBUG conditional around it.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 12 Comments »

Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub

Posted by jpluimers on 2018/12/13

Enabling stack traces in Delphi: [WayBack] Getting started · MahdiSafsafi/DebugEngine Wiki · GitHub:

Using DebugEngine stack trace when error occurs:

All what you need to do is to include DebugEngine.HookException unit into your project. And each time an error occurs, you will be able to get the stack trace from the point where the error occurred.

uses 
  DebugEngine.HookException;

{...}

procedure Foo;
begin
  try
    DoSomething;
  except
    on E: Exception do
      ShowMessage(E.StackTrace);
  end;
end;

You can get similar functionality with JCL.

Via [WayBack] Why Delphi (like other developer environments) natively not included full call stack for every exception? Or if this is possible, please tell me how (wi… – Jacek Laskowski – Google+

–jeroen

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

Initeresting CodeInsight ToolsAPI.pas bits IOTACodeInsightManager100, AllowCodeInsight, EditorTokenValidChars

Posted by jpluimers on 2018/12/12

Reminder to self: dig deeper in to this thread [WayBack] …In ToolsAPI.pas there’s IOTACodeInsightManager100 which is implemented by my custom CodeInsight manager… – Fl Ko – Google+

–jeroen

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