<div dir="ltr"><div dir="ltr">On Wed, Jan 1, 2020 at 6:51 PM Ondrej Pokorny <<a href="mailto:lazarus@kluug.net">lazarus@kluug.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you want to simplify a call, use a class helper:<br>
<br>
TStringsHelper = class helper for TStrings<br>
...<br>
procedure TStringsHelper.SaveToFileWithBOM(aFileName: string);<br>
begin<br>
   WriteBOM := True;<br>
   SaveToFile(aFileName);<br>
end;<br></blockquote><div><br></div><div>a bit more accurate version:</div><div><br></div>procedure TStringsHelper.SaveToFileWithBOM(aFileName: string);</div><div class="gmail_quote">var  prevBom : Boolean;</div><div class="gmail_quote">begin   </div><div class="gmail_quote">  prevBom := WriteBOM ;   </div><div class="gmail_quote">  try<br>

    

WriteBOM := True;<br>    SaveToFile(aFileName);   </div><div class="gmail_quote">  finally     </div><div class="gmail_quote">    WriteBom := prevBom;   </div><div class="gmail_quote">  end;<br><div>end;  :</div><div> </div></div></div>