<p>Thanks a lot for the feedback.</p>
<p>it worked as expected! The solution was:</p>
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff; overflow: auto; width: auto; border: solid gray; border-width: .1em .1em .1em .8em; padding: .2em .6em;">
<pre style="margin: 0; line-height: 125%;"><span style="color: #888888;">/* in DWScript world */</span>
<span style="color: #008800; font-weight: bold;">var</span> recA <span style="color: #333333;">:</span> JA;
recB <span style="color: #333333;">:</span> JB;
recC <span style="color: #333333;">:</span> JC;
<span style="color: #008800; font-weight: bold;">for</span> <span style="color: #008800; font-weight: bold;">var</span> k<span style="color: #333333;">:=</span><span style="color: #0000dd; font-weight: bold;">0</span> to <span style="color: #0000dd; font-weight: bold;">2</span> <span style="color: #008800; font-weight: bold;">do</span> begin
recC.id <span style="color: #333333;">:=</span> k;
recC.name <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">'abc'</span><span style="color: #333333;">+</span>IntToStr(k);
recC.age <span style="color: #333333;">:=</span> <span style="color: #0000dd; font-weight: bold;">10</span><span style="color: #333333;">+</span>k;
recB.field1 <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">'rec'</span><span style="color: #333333;">+</span> IntToStr(k);
recB.params.Add(recC);
recA.fields.Add(recB);
end;
<span style="color: #888888;">/* in Pas2JS world */</span>
<span style="color: #008800; font-weight: bold;">var</span> recA <span style="color: #333333;">:</span> JA;
recB <span style="color: #333333;">:</span> JB;
recC <span style="color: #333333;">:</span> JC;
k<span style="color: #333333;">:</span> Integer;
begin
<span style="color: #008800; font-weight: bold;">for</span> k<span style="color: #333333;">:=</span><span style="color: #0000dd; font-weight: bold;">0</span> to <span style="color: #0000dd; font-weight: bold;">2</span> <span style="color: #008800; font-weight: bold;">do</span> begin
recC.id <span style="color: #333333;">:=</span> k;
recC.name <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">'abc'</span><span style="color: #333333;">+</span>IntToStr(k);
recC.age <span style="color: #333333;">:=</span> <span style="color: #0000dd; font-weight: bold;">10</span><span style="color: #333333;">+</span>k;
recB.field1 <span style="color: #333333;">:=</span> <span style="background-color: #fff0f0;">'rec'</span><span style="color: #333333;">+</span> IntToStr(k);
TJSArray(recB.params).push(recC);
TJSArray(recA.fields).push(recB);
end;
</pre>
</div>
<p>Take a look at this array of record example, in Smart Pascal world, <strong>as long as the datatypes match</strong> (e.g. field params is a array of record), we have the pseudo methods functionality "built-in" for all arrays, for instance. Pas2JS could have this high level functionality as well. Using the Pas2JS approach with external classes interfaces it looks so powerful :)</p>
<img src="http://free-pascal-general.1045716.n5.nabble.com/file/t339674/codeinsight.png" border="0"/>
<br/><hr align="left" width="300" />
Sent from the <a href="http://free-pascal-general.1045716.n5.nabble.com/">Free Pascal - General mailing list archive</a> at Nabble.com.<br/>