<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Il 12/04/2023 21:17, Bo Berglund via fpc-pascal ha scritto:<br>
</p>
<blockquote type="cite"
cite="mid:k4ud3i5mh4po0jv66ita4ul6r20it7g597@4ax.com">
<pre wrap="">And if so, what is the rule for <b class="moz-txt-star"><span class="moz-txt-tag">*</span>when<span class="moz-txt-tag">*</span></b> to use var in function call argument
lists for items that will be changed inside the called function and used
afterwards?</pre>
</blockquote>
Your Wargs is defined as an open array, i.e. its length is unknown
at compile time. Therefore the compiler cannot pass it in the
subroutine call other than a pointer to the array. It cannot pass
the array content because it doesn't know its length.<br>
In that case you may omit the var specifier.<br>
But if one day you change your mind, and decide to establish a size
for your array, without var the compiler may decide to pass the full
array data to the procedure, and therefore whatever you do in your
procedure is done on the local copy of the array and not in the
original array. <br>
My suggestion is to specify "var" whenever your procedure is
expected to modify the data passed. It makes the program more
readable, even if "var" is redundant.<br>
<br>
Giuliano <br>
<pre class="moz-signature" cols="72">--
Do not do to others as you would have them do to you.They might have different tastes.</pre>
</body>
</html>