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

The Mysterious Case Of The Lost Inherited Call | The Art of Delphi Programming

Posted by jpluimers on 2018/06/25

A history lesson: not all minitor Delphi updates are binary compatible.[WayBack] The Mysterious Case Of The Lost Inherited Call | The Art of Delphi Programming.

I am looking forward to the solution that Uwe comes up with.

–jeroen

via [WayBack] Binary compatibility can be hard to achieve. The Mysterious Case Of The Lost Inherited Call https://www.uweraabe.de/Blog/2018/05/28/the-mysterious-cas… – Uwe Raabe – Google+

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

Dennis1000/mos6502-delphi: A MOS 6502 CPU emulator written in Delphi (a very basic C64 + VIC20 emulator included)

Posted by jpluimers on 2018/06/25

Really cool history: [Archive.isDennis1000/mos6502-delphi: A MOS 6502 CPU emulator written in Delphi (a very basic C64 + VIC20 emulator included)

It should run on most 32-bit Delphi versions.

via:

–jeroen

Posted in 6502, C64, Commodore, Delphi, Development, History, Software Development, VIC-20 | 2 Comments »

I wish the Delphi language supported multi-line strings

Posted by jpluimers on 2018/06/21

Very often, I see people ask for how to embed multi-line strings in a Delphi source file.

The short answer is: you can’t.

The long answer is: you can’t and if you want you have to hack your way around.

The answer should be: just like any of these languages that do support multiline strings:

Many languages support this through a feature called HEREDOC.

Now in Delphi and other languages like Java are building ugly workarounds like for instance this one: [WayBackRAD Studio Tip: Using resource scripts to organize project dependencies. – Chapman World.

–jeroen

Posted in .NET, C#, Delphi, Development, JavaScript/ECMAScript, Python, Ruby, Scripting, Software Development | 17 Comments »

Two cool features of the TestInsight treeview – navigate and copy

Posted by jpluimers on 2018/06/20

TestInsight is a great tool for automatically running your unit tests and seeing the results to make you more productive.

Two of the results treeview features you might not know make you even more productive:

  • After selecting a node, pressing Ctrl-C will copy the content as text to the clipboard
  • Double clicking will bring you to the unit test in your source code

You can get TestInsight at sglienke / TestInsight — Bitbucket

–jeroen

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

Class helpers and virtual methods – E2003 Undeclared identifier: ‘QueryInterface’/ ‘_AddRef’/’_Release’

Posted by jpluimers on 2018/06/20

Reminder to self: if you want to stay compatible with old (Pre Delphi XE) source code, then do not use virtual methods in class helpers.

Technically you can, as class helpers can inherit from other class helpers, but this is only supported as of Delphi XE.

In lower versions you get these errors as apparently the Delphi compiler tags an IInterface to the class helper compiler result:

[Error] Project1.dpr(14): E2003 Undeclared identifier: 'QueryInterface'
[Error] Project1.dpr(14): E2003 Undeclared identifier: '_AddRef'
[Error] Project1.dpr(14): E2003 Undeclared identifier: '_Release'

Source: [WayBackQualityCentral 9782

–jeroen

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

GExperts 1.3.10 experimental twm 2018-06-03 – twm’s blog

Posted by jpluimers on 2018/06/14

I just saved it to [WayBackGExperts 1.3.10 experimental twm 2018-06-03 – twm’s blog.

It includes:

–jeroen

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

Delphi MS OpenXML files – ZIP and XML…

Posted by jpluimers on 2018/06/14

If I ever need to do OpenXML in Delphi: [WayBack] For some years i’ve had a subsystem that directly manipulates MS OpenXML files… – Dany Marmur – Google+

Summary:

  • Zipping: units from mORMot. Brilliant! Fast. Does not puke!
  • XML:ing: Oxml (kluug.net).

–jeroen

 

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

Delphi, IBX and the Turkish I problem

Posted by jpluimers on 2018/06/13

Last year, it took a while to reproduce and it is likely not fixed anytime soon: if you use Delphi and IBX (InterBase Express) to connect to either InterBase or FireBird database, then in the Turkish locale do not use lowercase SQL in your Delphi code as it will break on the

I’ve decided to put this in a separate post than the one I discovered the issue in as that one focused on the Unicode and language background of the various i/I/ characters and this post on the Delphi part.

So for the non-Delphi part, read Source: Field “id” not found and the The Turkish-İ/I/i/ı and case conversion – Update on the dasBlog Turkish-I bug and a reminder to me on Globalization – Scott Hanselman.

More recently, I learned that the same problem also happens in the Azeri language or Azerbaijani language – Wikipedia via [WayBack] SQL Instance Collation – Language Neutral Required:

uppercase / lowercase mappings (though this only impacts 2 characters — dotted and dotless “i”/”I” — and for only 2 cultures — Azeri and Turkish)

In general, this problem is called [WayBack] Case Folding and many environments do not have good and ready to use solutions for this.

Basically when working with case-insensitive language identifiers, you should always use culture invariant text comparison operations. In most languages, people use either lowercase or uppercase converted operations which for Delphi >= come down to using :

The reason is simple:

  • without any parameter, ToLower and ToUpper will use [Archive.isSysLocale.DefaultLCID.
  • without any parameter, LowerCase and UpperCase will implicitly behave as if called with TLocaleOptions.loInvariantLocale, but lots of people forget they do.

The functions ToLowerInvariant and  ToUpperInvariant  were added in Delphi XE3, but ToLower(LocaleID) and ToUpper(LocaleID) in Delphi XE4.

Instead of doing uppercase and lowercase comparisons you could also use the [Archive.isSystem.SysUtils.CompareText function.

IBX however uses case conversion, and by now you will probably guessed it: IBX got it all wrong. One reproduction is at https://gist.github.com/jpluimers/643b382944ff991d07ec96abbf85548c and a thread with background is at [WayBack] What’s the Delphi equivalent of doing UpperCase with an InvariantCulture in Unicode Delphi versions? (XE and up) – Jeroen Wiert Pluimers – Google+

IBX isn’t alone: just search for other uppercase issues like Turkish i to see tons of other issues.

For IBX, I did the replacements in the diff below to fix it in Delphi XE8. I only replaced where identifiers were compared, not were actual database content was compared.

Unluckily, in the past IBX sources were hosted on CodeCentral at http://cc.embarcadero.com/Author/102 but no new bundles have been released since 2012.

Of all the locations I think IBX should not have used any case conversion here:

IBX.IBDatabaseINI.pasfunction LocalServerPath(sFile: string): string

This function uses LowerCase() but I think an NTFS specific comparison should have been used, but I’ve not investigated into a solution for that yet.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Grammar Zoo – Browsable Borland Delphi Assembler Grammar

Posted by jpluimers on 2018/06/12

Interesting: [WayBackGrammar Zoo – Browsable Borland Delphi Assembler Grammar.

It is very complete, including constructs like the [WayBackspecial directives VMTOFFSET and DMTINDEX for Delphi virtual and dynamic methods.

You can contribute to it using https://github.com/slebok/zoo/tree/master/zoo/assembly/delphi

–jeroen

Posted in Assembly Language, Delphi, Development, Software Development, x86 | Leave a Comment »

[dcc32 Fatal Error] MyProject.dpr(23): F2051 Unit GUITestRunner was compiled with a different version of DUnitX.TestFramework.ITest

Posted by jpluimers on 2018/06/12

If you ever get an error like these in Delphi XE8 and up

[dcc32 Fatal Error] MyProject.dpr(23): F2051 Unit GUITestRunner was compiled with a different version of DUnitX.TestFramework.ITest
[dcc32 Fatal Error] MyProject.dpr(23): F2051 Unit TextTestRunner was compiled with a different version of DUnitX.TestFramework.ITestListener

then you are likely your project is:

  • using a DUnit based test project in Delphi
  • not having the unit search paths defined

Solution:

  1. add this directory to your project search path: $(BDS)\source\DUnit\src
  2. ensure your project DCU output directory is writable

–jeroen

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