<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><div style='mso-element:para-border-div;border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm'><p class=MsoNormal style='border:none;padding:0cm'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Have you got the prof.rar?<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Amit<o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></a></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> fpc-pascal-bounces@lists.freepascal.org [mailto:fpc-pascal-bounces@lists.freepascal.org] <b>On Behalf Of </b>ik<br><b>Sent:</b> Wednesday, February 02, 2011 11:29 AM<br><b>To:</b> FPC-Pascal users discussions<br><b>Subject:</b> Re: [fpc-pascal] dynamic array and new/dispose<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><o:p> </o:p></p><div><p class=MsoNormal>On Wed, Feb 2, 2011 at 11:18, Amit Bueno <<a href="mailto:amitbueno@gmail.com">amitbueno@gmail.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal>I am compiling in a delphi mode.<br>Sorry for not posting a runnable source code,.<br>The code portion was taken from a huge source code, which is probably hard<br>to detach from the rest of the code.<br>It is reading a TStream object, which is an input 3ds file given to the app.<o:p></o:p></p><div><p class=MsoNormal><br>Can you write a small proof of concept that does exactly the same thing with the problem ?<br><br> <o:p></o:p></p></div><blockquote style='border:none;border-right:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm'><p class=MsoNormal><br>---<br><span style='color:#888888'>Amit</span><o:p></o:p></p><div><p class=MsoNormal><br>-----Original Message-----<br>From: <a href="mailto:fpc-pascal-bounces@lists.freepascal.org">fpc-pascal-bounces@lists.freepascal.org</a><o:p></o:p></p></div><div><p class=MsoNormal>[mailto:<a href="mailto:fpc-pascal-bounces@lists.freepascal.org">fpc-pascal-bounces@lists.freepascal.org</a>] On Behalf Of Jonas Maebe<br>Sent: Wednesday, February 02, 2011 11:17 AM<br>To: FPC-Pascal users discussions<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Subject: Re: [fpc-pascal] dynamic array and new/dispose<br><br><o:p></o:p></p></div><div><div><p class=MsoNormal>On 02 Feb 2011, at 09:20, Amit Bueno wrote:<br><br>> // creating and reading more data<br>> SubChunks[NewSubChunk]^.read(Fl);<br>><br>> // NewSubChunk function<br>> Function Chunk.NewSubchunk: integer;<br>> begin<br>> setlength(SubChunks, High(SubChunks)+2);<br>> New(subchunks[High(SubChunks)], create);<br>> SubChunks[High(SubChunks)]^.Data := Self.Data;<br>> Result := High(SubChunks);<br>> end;<br>><br>> // ---------<br>> The procedure fails when running the:<br>> SubChunks[NewSubChunk]^.read(Fl);<br>><br>> All the procedure works fine on Delphi, but on fpc under iMac it<br>> fails.<br>> Why?<br>><br><br>Are you compiling in Delphi mode? Please *always* post compilable<br>source code that demonstrates the problem when asking for help, not<br>uncompilable snippets. Don't make people guess about what you might<br>have written or about how you are compiling it.<br><br><br>Jonas<br>_______________________________________________<br>fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br><br>_______________________________________________<br>fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><o:p></o:p></p></div></div></blockquote></div><p class=MsoNormal style='margin-bottom:12.0pt'><br><br>Ido<br clear=all>LINESIP - Opening the source for communication<br><a href="http://www.linesip.com/" target="_blank">http://www.linesip.com</a><br><a href="http://www.linesip.co.il/" target="_blank">http://www.linesip.co.il</a><o:p></o:p></p></div></div></body></html>