<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2017-04-09 5:18 GMT+02:00 Ryan Joseph <span dir="ltr"><<a href="mailto:ryan@thealchemistguild.com" target="_blank">ryan@thealchemistguild.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> Is there anyway to make constants work in generics? </blockquote></div><br>sure, but not directly. Try this:</div><div class="gmail_extra"><br></div><div class="gmail_extra">=== code begin ===</div><div class="gmail_extra"><div class="gmail_extra">{$MODE DELPHI}</div><div class="gmail_extra"><br></div><div class="gmail_extra">type</div><div class="gmail_extra"> TA = record</div><div class="gmail_extra"> public const</div><div class="gmail_extra"> L = 16;</div><div class="gmail_extra"> end;</div><div class="gmail_extra"><br></div><div class="gmail_extra"> TB<T, L> = record</div><div class="gmail_extra"> public type</div><div class="gmail_extra"> FData = array[0..L.L] of T;</div><div class="gmail_extra"> end;</div><div class="gmail_extra"><br></div><div class="gmail_extra">var</div><div class="gmail_extra"> X: TB<Integer, TA>;</div><div class="gmail_extra"><br></div></div><div class="gmail_extra">=== code end ===<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Maciej Izak</div></div></div>
</div></div>