Hello Ted and Laurie,

Thanks for the info, I got this working by re-dimensioning the form array
just before the ACOPY.

Thanks for your help,
Kent

-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of Ted Roche
Sent: Thursday, August 22, 2013 7:08 AM
To: [email protected]
Subject: Re: ACOPY()

From:
http://msdn.microsoft.com/en-us/library/3y7ht0ww%28v=vs.80%29.aspx

"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<http://msdn.microsoft.com/en-us/library/76zh59sz%28v=vs.80%29.aspx>
."



On Thu, Aug 22, 2013 at 3:21 AM, Laurie Alvey <[email protected]>wrote:

> I've noticed that as well - ACOPY() will redimension the the target 
> array if the arrays are public or private variables. It doesn't always 
> work with arrays which are object properties - it's safer manually to 
> redimension the object array to match the input.
>
> Laurie
>
>
>
>
> ________________________________
>  From: Dave Crozier <[email protected]>
> To: ProFox Email List <[email protected]>
> Sent: Wednesday, 21 August 2013, 17:04
> Subject: RE: ACOPY()
>
>
> Kent,
> This works...
>
> ThisForm.AddProperty("aArray[1,1]",null)
>
> dimension aTemp[1,10]
>
> aTemp[1,1]="1,1"
> aTemp[1,2]="1,2"
> aTemp[1,10]="1,10"
>
> Acopy(aTemp, ThisForm.aArray)
>
> The array aArray gets redimensioned in the aCopy to [1,10]
>
> Dave
>
>
> -----Original Message-----
> From: ProFox [mailto:[email protected]] On Behalf Of Kent Belan
> Sent: 21 August 2013 16:51
> To: 'ProFox Email List'
> Subject: ACOPY()
>
> Hello,
>
> I don't work with arrays that often, but I need to now and am having 
> trouble.
>
> I created a form property for the array thisform.aEyeColor[1,2]
>
> I make a call to a business object to pull a query from the codes 
> table and return and array.
>
> The problem is when I try to copy the returned array into the 
> form.property I get an error.
>
> Private a_temp
> Dimension a_temp[1,2]
>
> oCodes.GetCodes('EYECOLOR', @a_temp)
>
> this returns the array correctly into the a_temp variable
>
> the problem is when I try to copy the array to the form variable
>
> ACOPY( a_temp, thisform.aEyeColor)
>
> I get the error "subscript is outside defined range"
>
> Does anyone know the trick to get this working ?
>
> Thanks,
> Kent
>
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to