Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>>>The whole array is passed in this case because the DO command passes parameters by reference (unless they are enclosed in the parenthesises).
>>
>>Yes. You're right. I just read that in the help. However, that's not obvious from the code. There really was no need to pass the array at all. Other code buried 3 and 4 levels deep are accessing other arrays without passing them.
>
>If the UDF in question calles some other subroutines that use array directly, than I would fix the code. Otherwise I don't see any harm in leaving it as is, but documenting it.
Only the routines where the array is passed refer to that array. However, since the array is received in the UDF with PARAMETERS not LPARAMETERS and the name is kept the same, any called routines would also be accessing the passed array, yes?
I would prefer to change all calls to stop using DO and clearly specify how things are being passed. However, I can't quickly be sure that all arrays are passed to the functions.
It is more wrong to have inconsistent architecture (than inconsistent style). By that I mean part of the code refers to different pseudo-public private arrays while these parts are passing the array. So I'll document that the array needn't have been passed and what change should be made.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only