Which of these function definitions do you guys prefer?
This one, using pass-by-reference:
<a name=createArrayFromFile array_name file_name starting_text ending_text>
<.....>
<$array_name = $array_name $something_else>
</a>
<!--function useage below-->
<createArrayFromFile array_name=$&myArray file_name="hello.txt" starting_text="<***" ending_text="***>">
<loop $myArray>
$myArray<BR>
</loop>
-------------------------------------------------------
Or this, with a <RETURN> value:
<a name=createArrayFromFile file_name starting_text ending_text>
<.....>
<loop....>
<$array_value = $array_value $something_else>
</loop>
<RETURN $array_value>
</a>
<createArrayFromFile file_name="hello.txt" starting_text="<***" ending_text="***>">
<$myArray = $ret>
<loop $myArray>
$myArray<BR>
</loop>
My preference is the first method, with pass-by-reference, since I don't have to do a $ret after the function call, but if that could cause me trouble down the line for whatever reason I'm more than happy to use the <RETURN> version instead.
This one, using pass-by-reference:
<a name=createArrayFromFile array_name file_name starting_text ending_text>
<.....>
<$array_name = $array_name $something_else>
</a>
<!--function useage below-->
<createArrayFromFile array_name=$&myArray file_name="hello.txt" starting_text="<***" ending_text="***>">
<loop $myArray>
$myArray<BR>
</loop>
-------------------------------------------------------
Or this, with a <RETURN> value:
<a name=createArrayFromFile file_name starting_text ending_text>
<.....>
<loop....>
<$array_value = $array_value $something_else>
</loop>
<RETURN $array_value>
</a>
<createArrayFromFile file_name="hello.txt" starting_text="<***" ending_text="***>">
<$myArray = $ret>
<loop $myArray>
$myArray<BR>
</loop>
My preference is the first method, with pass-by-reference, since I don't have to do a $ret after the function call, but if that could cause me trouble down the line for whatever reason I'm more than happy to use the <RETURN> version instead.