<div dir="ltr"><br clear="all"><div class="">
<div class="" id="msg_135701">Hello,<br><br></div><div class="" id="msg_135701">I posted this on the forum, but maybe the forum is not the best place, so I post it here too.<br></div><div class="" id="msg_135701">
<br>I have an "Incompatible type" error which I can't figure out<br><br><div class=""></div><pre style="margin:0px;padding:0px"><code class="">program DominoMo;<br><br>{$MODE Delphi}<br><br>uses<br> Globals in 'GLOBALS.PAS',<br>
Parametr in 'PARAMETR.PAS';<br><br>begin<br>end.<br></code></pre><div class=""> </div><pre style="margin:0px;padding:0px"><code class="">unit GLOBALS ;<br><br>{$MODE Delphi}<br><br>interface<br><br> uses Laz2_Dom, Laz_XmlRead, Laz_XmlWrite ;<br>
<br> const XML_FILE_NAME = 'DominoMot.xml' ;<br><br> var XmlWordLists : TXmlDocument ;<br><br>implementation<br><br>initialization<br> {16} ReadXmlFile (XmlWordLists, XML_FILE_NAME)<br>end.<br></code></pre><div class="">
<br></div><pre style="margin:0px;padding:0px"><code class="">unit PARAMETR ;<br><br>{$MODE Delphi}<br><br>interface<br><br>uses SysUtils, XmlWrite, GLOBALS;<br><br>implementation<br><br> procedure InitAndShowModal ;<br>
begin<br>
{13} //WriteXmlFile (XmlWordLists, ChangeFileExt (ParamStr (0), '.xml'))<br> end ;<br><br>end.<br></code></pre><br>Using Lazarus 1.2RC1, I get: PARAMETR.PAS(13,69) Error: Incompatible type for arg no. 2: Got "AnsiString", expected "TStream"<br>
If I comment out line 16, the project compiles OK.<br>If I put my cursor on ReadXmlFile and press Alt+Up, the editor jumps to the correct overloaded version<br>If I put my cursor on WriteXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version<br>
<br>Using
Lazarus 1.0.14, I get: GLOBALS.PAS(16,43) Error: Incompatible type for
arg no. 2: Got "Constant String", expected "TStream"<br>If I comment out line 16, the compiler stops on the same error as for 1.2RC1<br>If I put my cursor on ReadXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version<br>
If I put my cursor on WriteXmlFile and press Alt+Up, the editor skips the string version and jumps to the stream version<br><br>I can't figure any of those errors:<br>None
should occur as far as I can see, as ReadXMLFile and WriteXMLFile both
have overloaded versions which take an ansistring for second parameter.<br><br>Is this a bug or am I missing something?<br></div>
</div>
<br>
<div class="" id="modified_135701">
</div>
-- <br>Frederic Da Vitoria<br>(davitof)<br><br>Membre de l'April - « promouvoir et défendre le logiciel libre » - <a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</div>