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,995 other followers

Archive for the ‘Delphi’ Category

delphi – How to reset the download when the GetIt package manager fails? – Stack Overflow

Posted by jpluimers on 2020/07/08

Since GetIt is hardly, if at all documented, but has quite a few of problems, I will likely need to use this another time: [WayBack] delphi – How to reset the download when the GetIt package manager fails? – Stack Overflow

TL;DR:

Luis Navarro from Embacadero just explained to me:

Close the IDE, then delete the OmniThread folder from MyDocuments\Embarcadero\Studio\17.0\CatalogRepository After that, you have to edit the registry and delete also the Omnithread folder from HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\17.0\CatalogRepository\Elements

Related: [RSP-12387] GetIt does not reset the download when Delphi crashes whilst downloading. – Embarcadero Technologies

Via:

–jeroen

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

delphi – How do I build an array of const? – Stack Overflow

Posted by jpluimers on 2020/07/02

As I one day likely need to pas a dynamically created array of const from scratch (which behind the scenes actually is an array of TVarRec, where each element is, TVarRec which is a variant record that can have both values and pointers to values. So the result will be kind of a mess (:

Further reading:

–jeroen

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

Specifying the msbuild configuration for a Delphi project on the commandline ‚Äď twm’s blog

Posted by jpluimers on 2020/07/02

Reminder to self: check my own build configurations as there is a difference for Delphi 2007 and Delphi >= 2009: [WayBack]¬†Specifying the msbuild configuration for a Delphi project on the commandline ‚Äď twm’s blog.

Thomas indicate that:

  • Delphi 2007 uses /p:Config=Debug¬†(or Release)
  • Delphi 2009+ uses¬†/p:Configugration=Debug¬†(or Release)

From my own notes, I think Delphi >= 2009 also understands the Delphi 2007 way.

Via:¬†[WayBack] Starting with Delphi 2007 EmBorCodera switched to msbuild for the build system. The newly introduced .dproj file used since then is a valid build script… – Thomas Mueller (dummzeuch) – Google+

References:

–jeroen

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

Delphi Exception handling code review reminders

Posted by jpluimers on 2020/06/18

I bumped into [WayBack]When an exception is nil in the exception handler ‚Äď twm’s blog¬†for some legacy code a while ago.

Some code review reminders:

  • raise Exception(¬†is always wrong: no exception instance is created
  • Exception.Create(¬†without a raise is wrong most of the times
  • except end¬†is almost always wrong
  • except¬†and finally¬†in encompassing blocks often is a code smell

I need to check which ones are caught by [WayBack] Code Analysis Tool | FixInsight for Delphi (which is not at [WayBack] TMS Software | VCL, FMX, ASP.NET, .NET controls & components for Delphi, C++Builder & Visual Studio | TMS FixInsight Pro.)

–jeroen

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

Chr equivalent for Unicode in Delphi 7 – Stack Overflow

Posted by jpluimers on 2020/06/17

From a long time ago: [WayBack] chr equivalent for Unicode in Delphi 7 РStack Overflow answered by David Heffernan:

Q

I need to initialize a Widestring in Delphi 7 but I can’t use¬†chrfunction which is ANSI

var
  ws : Widestring;
begin

 ws := chr($FFFF) + chr($FFFF) + chr($FFFF);

end;

What can I use, then ?

A

I’m not sure there’s a simply way to do what you wish. You can convert a¬†Word¬†into a¬†WideChar¬†with a simple cast:

WideChar($FFFF)

but you cannot concatenate WideChar. So this is a compiler error:

WideChar($FFFF) + WideChar($FFFF)

You could use a helper function to get the job done:

function InitialiseWideString(const chars: array of Word): WideString;
var
  i: Integer;
begin
  SetLength(Result, Length(chars));
  for i := 0 to high(chars) do
    Result[i+1] := WideChar(chars[i]);
end;

Then you can call it like this:

ws := InitialiseWideString([$0054, $0069, $006D, $0065, $0020, $0074, $006F, 
  $0020, $0075, $0070, $0067, $0072, $0061, $0064, $0065]);

–jeroen

Posted in Delphi, Delphi 7, Development, History, Software Development | 3 Comments »

 
%d bloggers like this: