Delphi: Pitfalls of Anonymous methods and Capture

I was writing a web request handler when I ran into a problem. I was plugging in multiple handlers, but only one of them actually worked.


To get to the essence of it, this doesn’t work

procedure TMyClass.Setup;
  Handler: THandlerClass;
  hType: THandlers;
  for hType in [foo, bar]
  do begin
    case hType of
      foo: Handler := TFoo.Create;
      bar: Handler := TBar.Create;

Zipped example source code:

Continue reading “Delphi: Pitfalls of Anonymous methods and Capture”

About Us |

Another social media site created in the wake of the G+ ShutDown.

I am testing it as

Very, very fresh. Not all paint is dry yet. It has a decent look and feel but could use some tweaking. Unfortunately, it is also still walled in, meaning posts are hidden until you log in.

The great thing about G+ was the ability share in public, relink in other media, and view posts without having to log in.


Source: About Us |