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 2,343 other followers

Archive for the ‘History’ Category

Certified Secure – XS4ALL Challenge

Posted by jpluimers on 2021/04/23

This was a cool one a few years back: [WayBack] Certified Secure – XS4ALL Challenge


Posted in Fun, History, Power User, Security | Leave a Comment »

The Architecture of Open Source Applications: Sendmail

Posted by jpluimers on 2021/04/12

Cool historic article: [WayBack] The Architecture of Open Source Applications: Sendmail by Eric Allman.

It is Chapter 17 of this book [WayBack]:

The Architecture of
Open Source Applications

Amy Brown and Greg Wilson (eds.)
ISBN 978-1-257-63801-7

I totally missed that book being published in 2014.

Great historic read!


Posted in *nix, *nix-tools, History, Power User, sendmail | Leave a Comment »

em-dosbox – Windows 3.11 on the Web

Posted by jpluimers on 2021/03/22

Cool: [] em-dosbox – Windows 3.11 on the Web.

Via [WayBack] JRWR – Forrest F. on Twitter: “I love this thing, Boots into Windows 3.11 with a internet connection (over a fake modem!)”


Read the rest of this entry »

Posted in History, Windows, Windows 3.11 | 2 Comments »

You are likely to be eaten by a grue! #NerdStitch cross stitch project- Zork 1 (Apple II version)

Posted by jpluimers on 2021/03/08

This is so cool: [WayBack] Glenda 🐰 on Twitter: “You are likely to be eaten by a grue! Just finished a new #NerdStitch cross stitch project- Zork 1 (Apple II version). The second adventure game I ever played. #zork #EatenByAGrue #apple2 #Infocom” .

That cursor!

Read the rest of this entry »

Posted in Fun, History | Leave a Comment »

Delphi XE7 introduced const support for dynamic arrays; prior versions used [] only for sets.

Posted by jpluimers on 2021/03/02

A few things to learn from [WayBack] delphi – Constant array of cardinal produces error ‘Constant expression violates subrange bounds” – Stack Overflow:

  • Delphi XE7 introduced compiler support for const dynamic arrays.
  • Compiler errors can completely put you in the wrong direction.
  • Command-line compilers indicate BDS versions which can confuse you for the exact product versions (thanks Rudy Velthuis for correcting that).


In this case, Delphi XE6 and below regard the [...] construct for constants as a set of Byte of which the maximum value is 255.

So this already fails with E1012 Constant expression violates subrange bounds, even though 257 perfectly fits the subrange of Cardinal:

  CardinalArray: array of Cardinal = [257];

The documentation (which has not changed since Delphi 2007) puts you in a totally different direction: [WayBack] x1012: Constant expression violates subrange bounds

x1012: Constant expression violates subrange bounds

This error message occurs when the compiler can determine that a constant is outside the legal range. This can occur for instance if you assign a constant to a variable of subrange type.

program Produce;
  Digit: 1..9;
  Digit := 0;  (*Get message: Constant expression violates subrange bounds*)
program Solve;
  Digit: 0..9;
  Digit := 0;

The alternative is to use a non-dynamic array that uses parenthesis instead of square brackets for initialisation:

  CardinalArray: array[0..0] of Cardinal = (257);

Dynamic arrays

Const initialisation of dynamic arrays only made a tick mark on the box in [] What’s New in Delphi and C++Builder XE7 – RAD Studio: String-Like Operations Supported on Dynamic Arrays, but in fact this code works in Delphi XE7 and up just fine:

program Cardinals;



  CardinalArray: array of Cardinal = [257]; // fails until Delphi XE6 with "E1012 Constant expression violates subrange bounds"

  ANSICOLORS: array of Cardinal = [
    $800000,//1, compilation error starts with this value

  AnsiColor: Cardinal;

    for AnsiColor in AnsiColors do
      Writeln(Format('$%6.6x', [AnsiColor]));
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);



Note that dynamic arrays are unlike regular arrays, which for instance means that nesting them can get you into a different uncharted territory when using multiple dimensions.

Unlike an array, a dynamic array has notice of length. Which means it needs extra memory for it.

So where regular multi-dimensional arrays are blocks of memory. Multi-dimensional dynamic arrays are a dynamic array on each dimension level, which means extra length keeping, and the seemingly odd Copy behaviour described in [WayBack] Things that make you go ‘urgh’… | Delphi Haven:

What’s the flaw in this test code?

program Project1;
  Arr1, Arr2: array of array of Integer;
  I, J: Integer;
  SetLength(Arr1, 5, 5);
  for I := 0 to 4 do
    for J := 0 to 4 do
      Arr1[I, J] := I * J;
  Arr2 := Copy(Arr1);
  for I := 0 to 4 do
    for J := 0 to 4 do
      if Arr2[I, J] <> Arr1[I, J] then
  Write('Press ENTER to exit...');

with these comments

Rudy Velthuis:

Dynarrays are single-dimensional. One can get the illusion of multi-dimensionality because the Delphi syntax lets you access them using a[5,6] syntax, and SetLength takes more than one dimension parameter, and indeed, the docs even mention multi-dimensional, but that doesn’t change anything. You don’t have a multi-dimensional dynarray, you have a dynarray than contains other dynarrays. Each of these is one-dimensional. IOW, you don’t have one array, you have a cluster of dynarrays.

Copy() handles dynarrays. These are one-dimensional, so it only does one dimension (what else?). IOW, the behaviour is correct and actually well known.


I’m with you Chris. I don’t think this is “well known”, maybe because mono-dimensional dynamic arrays are probably used much more than multidimensional ones.
And also, the documentation is blaringly silent on this behavior. (credit to DelphiBasics to mention it:
The more visibility it gets, the less bugs we’ll have to deal with.

IMO, I don’t see why “copy” would not behave recursively and copy each sub-array as well. It seems that it is the intuitive behavior people tend to expect in the 1st place. (either nothing at all like Arr1:=Arr2, or a full recursive copy)
But since it’s been like that for some time, I doubt it can change for compatibility reasons (breaking code relying explicitly on this behavior).


Thanks for the support! On my reading, the help strongly implies the behaviour I was expecting, and therefore, implies the actual behaviour to be a bug. Specifically, the entry for Copy ( includes the line:

Note: When S is a dynamic array, you can omit the Index and Count parameters and Copy copies the entire array.

What could ‘the entire array’ mean? According to Rudy, this can’t mean more than one dimension because dynamic arrays aren’t multidimensional. And yet, the Delphi Language Guide talks of ‘multidimensional dynamic arrays’ quite clearly ( See also the docs for SetLength (


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

%d bloggers like this: