Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
To fix or not to fix, that is the question
Message
From
11/07/2006 10:57:29
Mike Yearwood
Toronto, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01135306
Message ID:
01135351
Views:
10
>>>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
Map
View

Click here to load this message in the networking platform