<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Calibri, Arial, Verdana, sans-serif; font-size: 12pt;">In my view that's exactly what a procedure is for: Accept some parameters, do some processing, store some data elsewhere, return some results via parameters. <br><br>Functions, on the other hand, should be more limited. Accept some data, perform one function, return one result, having no side effects.<br><br>Other languages like everything to be functions which is where the predilection toward them comes from. The worst form of this is functions that have side effects, return one result, but then also return additional results via parameters. Arrgghh!<br><div><br></div><div style="" class="zmail_extra"><div id="Zm-_Id_-Sgn1">---- On Sun, 15 Sep 2019 18:59:51 -0400 <b>Tomas Hajny <<a target="_blank" href="mailto:XHajT03@hajny.biz">XHajT03@hajny.biz</a>></b> wrote ----<br></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); padding-left: 6px; margin: 0px 0px 0px 5px;"><div>On 2019-09-16 00:29, DougC wrote:<br>> But to fully correct the situation, I would also change it to a<br>> procedure since leaving it as a function still suggests it only<br>> returns a result and has no other side effects.<br><br>No, changing it to a procedure would not work - the information whether <br>BOM was found and thus the codepage in the text file record was set <br>accordingly, or whether the information was not available, is very <br>important for further processing (as an example, the programmer may ask <br>the end user to provide information about the text file encoding in such <br>a case). Purely from technical point of view, it would be possible to <br>change it to a procedure and move the return value to a new actual <br>parameter, but it doesn't make much sense from my point of view.<br></div></blockquote></div><div><br></div></div><br></body></html>