<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">El 16/12/2015 a las 17:25, Sven Barth
escribió:<br>
</div>
<blockquote
cite="mid:CAFMUeB81LKVMDRTrgkW96AOzUi6qCQCEhRGEApwNSEqkHJL1YQ@mail.gmail.com"
type="cite">
<p>Am 16.12.2015 16:12 schrieb "Santiago A." <<a
moz-do-not-send="true" href="mailto:svaa@ciberpiula.net"><a class="moz-txt-link-abbreviated" href="mailto:svaa@ciberpiula.net">svaa@ciberpiula.net</a></a>>:<br>
><br>
> Type<br>
> TRegAlias=record<br>
> AliasName:string<br>
> ...<br>
> end;<br>
><br>
> TArrayAlias=specialize TArray<TRegAlias>; //
<==== Error here<br>
><br>
> defconexion.pas(71,14) Error: Identifier not found
"specialize"<br>
> defconexion.pas(71,25) Error: Error in type definition<br>
> defconexion.pas(71,25) Fatal: Syntax error, ";" expected
but "identifier<br>
> TARRAY" found<br>
><br>
><br>
> Why this error?<br>
> Why does the compiler try to look for a Identifier
"specialize" instead<br>
> of interpreting it as a reserved word?</p>
<p>Which FPC version? Which language mode?</p>
</blockquote>
{$mode Delphi}<br>
<br>
I've just tried {$mode objfpc} and compiles type declaration,
(Delphi mode can't understand generics?)<br>
<br>
But now I have another problem, when I use the variable, I get
"Argument can't be assigned to"<br>
<br>
<tt>var </tt><tt><br>
</tt><tt> </tt><tt>arrayAlias:TArrayAlias;</tt><tt><br>
</tt><tt> aliasList:TStringList;</tt><tt><br>
...<br>
begin<br>
</tt><tt>...</tt><tt><br>
</tt><tt> arrayAlias[i].AliasName:=aliasList[i]; //<==== Error
here</tt><tt><br>
</tt><tt><br>
</tt>Where TArrayAlias=TArray<TRegAlias>, and TArray<_T>
is an object, not a class.<br>
And it has a property <br>
<br>
<tt> property item[index:Integer]:_T read getItem write
setItem; default;</tt><br>
<br>
So, it has the getter and the setter.<br>
<br>
Doesn't objfpc mode accept default indexed properties?<br>
<br>
<pre class="moz-signature" cols="72">--
Saludos
Santi
<a class="moz-txt-link-abbreviated" href="mailto:svaa@ciberpiula.net">svaa@ciberpiula.net</a></pre>
</body>
</html>