Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing an array property by reference
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00060585
Message ID:
00061501
Views:
44
>>>>>>Oh, well. Thanks to everyone who tried to help.
>>>>>>
>>>>>>Maybe I should report this to Microsoft as a bug (in their next beta).
>>>>>
>>>>>Tom,
>>>>>
>>>>>I don't think that this is a bug. For one thing, VFP passes all objects by reference, so when you add the @ you're really not doing anything. In this case, since VFP doesn't know anything about what the object is it evaluates the first element. Note that this is consistent with the way the TYPE() function works. Certainly, I wish that this wasn't the case, but it's been this way for so long, that I don't anticipate them making any changes.
>>>>>
>>>>>George
>>>>
>>>>Yes, but how can you send a property by reference to a function?
>>>>
>>>>Vlad
>>>
>>>Vlad,
>>>
>>>Individual properties cannot be sent by reference without first assigning it to an intermediate value. Otherwise an error is generated. The intermediate value can then be passed by reference and re-assigned. This is not only applies to arrays, but character, numeric, and logical values.
>>>
>>>George
>>
>>I know that. And, usually, it's not so bad for strings, numeric, etc. But for arrays this is bad because you usually don't want to copy arrays... :)
>>
>>Vlad
>
>Do you think that this is in any way connected to the same reason that TYPE() doesn't work properly on arrays? The debugger recognizes them, but the function doesn't. Maybe it's something that they'll fix in the next version. I wonder if anyone's put this on the "Wish List".
>
>George

I don't see any connection. IMHO, TYPE() is consistent. I don't remember to see this in the Wish List. You can do it. :)

Vlad
Previous
Reply
Map
View

Click here to load this message in the networking platform