Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying one array to another
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00089652
Message ID:
00089672
Views:
27
>I'm trying to add the elements in one array to another. When I use the acopy function to indicate at which element to add the new elements
>it doesn't work.
> acopy(details, fileinfo, 1, 3, 54)
>
>where 1 = 1st source element
> 3= no of elements
> 54 = 1st source destination.
>
>when I just use acopy(details, fileinfo)
>
>it copies the 3 elements from details to fileinfo but overwrites the
>first three elements in fileinfo.
>
>Is there another function to add these elements together. Using Append from requires a file and not an array.
>
>any suggestions would be greatly appreciated. Thanks in advance.
>
>Sheena E.

You should first redimension the destination array for the sum of the elements of the two arrays. Try the following before your ACOPY:

DIMENSION FILEINFO(56,[Your Columns])

This will add three new elements to your existing array. I assume that 53 is the last element in FILEINFO. To automate this, try the following:

DIMENSION FILEINFO((ALEN(Details)/[Details' column count])+;
(ALEN(FILEINFO)/[Fileinfo's column count]),;
[Fileinfo's column count])
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform