It has to be either a bug in FoxPro or an error in the documentation, right?

Documentation says "If the destination array already exists, it is
redimensioned to the size of the source array."


DIMENSION arrayX(4, 5)
DIMENSION arrayY(1, 5)
ACOPY(arrayX, arrayY) && gets "Subscript is outside defined range"
error

Re: ACOPY() bug by Fred

Fred
Sun Mar 20 23:03:54 CST 2005

From the VFP9 help under Remarks for ACOPY():
Copying a member array to an existing non-member array with certain
dimensions using the ACOPY( ) function might generate the error, "Subscript
is outside defined range." You can avoid this error changing the dimension
of the destination array to a single element before calling ACOPY( ). For
more information, see DIMENSION Command.



--
Fred
Microsoft Visual FoxPro MVP


"Paul Pedersen" <no-reply@swen.com> wrote in message
news:Ot9wyScLFHA.2136@TK2MSFTNGP14.phx.gbl...
> It has to be either a bug in FoxPro or an error in the documentation,
> right?
>
> Documentation says "If the destination array already exists, it is
> redimensioned to the size of the source array."
>
>
> DIMENSION arrayX(4, 5)
> DIMENSION arrayY(1, 5)
> ACOPY(arrayX, arrayY) && gets "Subscript is outside defined range"
> error
>
>
>



Re: ACOPY() bug by Paul

Paul
Sun Mar 20 23:28:36 CST 2005

So it's a bug. At least there's a workaround - dimension the array before
copying.

Anyway, neither of these arrays is a member of anything.



"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:eCBfhNdLFHA.732@TK2MSFTNGP12.phx.gbl...
> From the VFP9 help under Remarks for ACOPY():
> Copying a member array to an existing non-member array with certain
> dimensions using the ACOPY( ) function might generate the error,
> "Subscript is outside defined range." You can avoid this error changing
> the dimension of the destination array to a single element before calling
> ACOPY( ). For more information, see DIMENSION Command.
>
>
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "Paul Pedersen" <no-reply@swen.com> wrote in message
> news:Ot9wyScLFHA.2136@TK2MSFTNGP14.phx.gbl...
>> It has to be either a bug in FoxPro or an error in the documentation,
>> right?
>>
>> Documentation says "If the destination array already exists, it is
>> redimensioned to the size of the source array."
>>
>>
>> DIMENSION arrayX(4, 5)
>> DIMENSION arrayY(1, 5)
>> ACOPY(arrayX, arrayY) && gets "Subscript is outside defined range"
>> error
>>
>>
>>
>
>



Re: ACOPY() bug by Fred

Fred
Sun Mar 20 23:34:23 CST 2005

Nah, once it's documented, it becomes a *feature*. ;)


--
Fred
Microsoft Visual FoxPro MVP


"Paul Pedersen" <no-reply@swen.com> wrote in message
news:eBDdWbdLFHA.1172@TK2MSFTNGP12.phx.gbl...
> So it's a bug. At least there's a workaround - dimension the array before
> copying.
>
> Anyway, neither of these arrays is a member of anything.
>
>
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:eCBfhNdLFHA.732@TK2MSFTNGP12.phx.gbl...
>> From the VFP9 help under Remarks for ACOPY():
>> Copying a member array to an existing non-member array with certain
>> dimensions using the ACOPY( ) function might generate the error,
>> "Subscript is outside defined range." You can avoid this error changing
>> the dimension of the destination array to a single element before calling
>> ACOPY( ). For more information, see DIMENSION Command.
>>
>>
>>
>> --
>> Fred
>> Microsoft Visual FoxPro MVP
>>
>>
>> "Paul Pedersen" <no-reply@swen.com> wrote in message
>> news:Ot9wyScLFHA.2136@TK2MSFTNGP14.phx.gbl...
>>> It has to be either a bug in FoxPro or an error in the documentation,
>>> right?
>>>
>>> Documentation says "If the destination array already exists, it is
>>> redimensioned to the size of the source array."
>>>
>>>
>>> DIMENSION arrayX(4, 5)
>>> DIMENSION arrayY(1, 5)
>>> ACOPY(arrayX, arrayY) && gets "Subscript is outside defined
>>> range" error
>>>
>>>
>>>
>>
>>
>
>