<div dir="ltr">If your form is a binary form (as David said, text is recommended because of situations like this), you can convert it to text by creating a new form with a button that uses ObjectBinaryToText.<div><br></div><div>LMemoryStream := nil;</div><div>LFileStream := nil;<br></div><div></div><div>LMyForm := TMyForm.Create; // TMyForm is the form you want a text version of</div><div>try<br></div><div><div> LMemoryStream := TMemoryStream.Create;<br></div><div> LMemoryStream.WriteComponent(LMyForm);</div><div> LMemoryStream.Position := 0;</div><div> LFileStream := TFileStream.Create('c:\yourformname.dfm'); // or wherever you want to put it and whatever you want to call it<br></div><div></div><div> ObjectBinaryToText(LMemoryStream, LFileStream);</div><div>finally</div><div> LMemStream.Free;</div><div> LFileStream.Free;</div><div> LMyForm.Free;</div><div>end;</div></div><div><br></div><div>Cheers,</div><div>Karl</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 23, 2018 at 2:31 PM, Errol Anderson <span dir="ltr"><<a href="mailto:errol.anderson@gsds.co.nz" target="_blank">errol.anderson@gsds.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-NZ" link="#0563C1" vlink="#954F72"><div class="m_-2545097662044636806WordSection1"><p class="MsoNormal">After a (worrying) computer crash, it appeared that my main form, main.pas, was corrupted. So I reverted to main.pas and main.dfm which I had committed to the git server last night.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Now when I open the project or the main form using Delphi XE10.1, I get the following error, and I cannot display the form on pressing F12.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span><img width="359" height="119" id="m_-2545097662044636806Picture_x0020_2" src="cid:image003.png@01D39456.ED078E30"></span><u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"> However, the program compiles and displays the form when I run it, so it looks like main,dfm is substantially OK. <u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Any ideas how I can retrieve the form would be most welcome.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks and regards<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Errol<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:red">Errol Anderson <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Geothermal Resource Analyst | Software Development<u></u><u></u></span></p><p class="MsoNormal"><span lang="DA" style="font-size:10.0pt">GSDS Ltd </span><span lang="EN-US" style="font-size:10.0pt"><a href="http://www.gsds.co.nz/" target="_blank"><span lang="DA" style="color:blue">www.gsds.co.nz</span></a></span><span lang="DA" style="font-size:10.0pt"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Mob: <a href="tel:+64%2021%20181%203367" value="+64211813367" target="_blank">+64 (0)21 181 3367</a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Email: <a href="mailto:errol.anderson@gsds.co.nz" target="_blank"><span style="color:blue">errol.anderson@gsds.co.nz</span></a><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt">Skype: errol_anderson<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:2.0pt"><u></u> <u></u></span></p><p class="MsoNormal"><span><img border="0" width="288" height="49" id="m_-2545097662044636806Picture_x0020_1" src="cid:image004.jpg@01D39456.ED078E30" alt="Logo_final2_90"></span><span lang="EN-US" style="font-size:2.0pt"><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-AU" style="font-size:8.0pt">This communication and any attached material contains confidential information intended only for the use of the addressee named above. No confidentiality is waived or lost by any mistaken transmission to you. If you have received this message in error please delete the document and notify us immediately.</span><span lang="EN-US" style="font-size:8.0pt"><u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br>______________________________<wbr>_________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/">http://delphi.org.nz/mailman/</a><wbr>listinfo/delphi<br>
Unsubscribe: send an email to delphi-request@listserver.123.<wbr><a href="http://net.nz">net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>