<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-02-25 5:45 GMT-03:00 Sven Barth <span dir="ltr"><<a href="mailto:pascaldragon@googlemail.com" target="_blank">pascaldragon@googlemail.com</a>></span>:</div>

<div class="gmail_quote">[...]<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class="">
So, which syntax to use generic and meta class?<br>
</div></blockquote>
<br>
What might work (untested) is this:<br>
<br>
=== code begin ===<br>
<br>
type<div class=""><br>
  generic TMyGeneric<T> = class<br></div>
  public type<br>
    TMyGenericClass = class of TMyGeneric; // in mode Delphi this would be "class of TMyGeneric<T>"<br>
  public<br>
    class procedure RegisterItem(aItemClass: TMyGenericClass);<br>
  end;<br>
<br>
=== code end ===<div class=""><div class="h5"><br>
Regards,<br>
Sven</div></div></blockquote></div><div><br></div><div>Can I use this "metatype" in other class? E.g.:</div><div><br></div><div><div>  generic TMyGeneric<T> = class</div><div>  public type</div><div>    TMyGenericClass = class of TMyGeneric;</div>

<div>  end;</div><div><br></div><div>  TMyService = class</div><div>  public</div><div>    class procedure RegisterItem(aItemClass: TMyGenericClass); // maybe "aItemClass: TMyGeneric.TMyGenericClass"?</div><div>

  end;</div></div><div><br></div><div>I tried that but:</div><div><br></div><div><div>"Identifier not found "TMyGenericClass"".</div></div><div><br></div>--<br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>