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

Archive for May 21st, 2020

learning golang

Posted by jpluimers on 2020/05/21

Interesting course: [WayBack] Go: The Complete Developer’s Guide (Golang) | Udemy Master the fundamentals and advanced features of the Go Programming Language (Golang)

It covers:

  • Basics / Hello world
  • Structs
  • Pointers
  • Interfaces
  • Channels / Go Routines

–jeroen

Posted in Development, Go (golang), Software Development | Leave a Comment »

David Korn Tells All – Slashdot

Posted by jpluimers on 2020/05/21

Almost 20 years old, but still a very nice read [Archive.is] David Korn Tells All – Slashdot.

Another funny story involving David Korn during the not-so open source times of Microsoft late last century: [WayBack] Korn Shell Story

–jeroen

Posted in *nix, *nix-tools, bash, bash, Development, History, Power User, Scripting, Software Development | Leave a Comment »

Why the compiler generates a `”E2018 Record, object or class type required”` on typed types…

Posted by jpluimers on 2020/05/21

From [WayBack] Why would the compiler generate a "E2018 Record, object or class type required" helper when I use a ToUpperInvariant (or any TStringsHelper call) on t… – Jeroen Wiert Pluimers – Google+:

Why would the compiler generate a "E2018 Record, object or class type required" when I use a ToUpperInvariant (or any TStringsHelper call) on the Text property of a TEdit?

Full failing code is at [WayBack] https://gist.github.com/jpluimers/b5e3684f725216622bdcb80bf5f10698

Failing line is this:

Edit1.Text := Edit1.Text.ToUpperInvariant;
// the above line generates this error:
// [dcc32 Error] MainFormUnit.pas(29): E2018 Record, object or class type required

This fails as well:

Edit1.Text := TStringHelper.ToUpperInvariant(Edit1.Text);

Why would the compiler (in this case XE8) throw this error?

Note the workaround is simple:

var
  lText: string;
begin
  lText := Edit1.Text;
  Edit1.Text := lText.ToUpperInvariant;

My suspicion is that the Edit property is of type TCaption which is type string.

Could it be that simple?

To which David Heffernan responded:

Yup, the issue is TCaption has no helper. Pretty distressing.

Typed types are indeed different types. They have been there for a long time (to facilitate generating different type information so you can for instance hook up different property editors to TCaption (a typed string) or TColor (a typed integer).

It is explained at [WayBack] Declaring Types. but has existed since Delphi 1 or Delphi 2.

More on the implications is at [WayBack] pascal – Delphi Type equivalence and Type equality syntax – Stack Overflow.

–jeroen

Read the rest of this entry »

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

 
%d bloggers like this: